diff --git a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.csproj b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.csproj index e81aa4d309f9..2d64bb4fe659 100644 --- a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.csproj +++ b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.csproj @@ -2,9 +2,9 @@ CostManagement CostManagement + CostManagement.Autorest - diff --git a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.format.ps1xml b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.format.ps1xml index 67ba9e8afdae..d243d8ac7160 100644 --- a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.format.ps1xml +++ b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.format.ps1xml @@ -2,279 +2,20 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostManagementIdentity - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostManagementIdentity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AlertId - - - BillingAccountId - - - BillingProfileId - - - ExportName - - - ExternalCloudProviderId - - - ExternalCloudProviderType - - - OperationId - - - Scope - - - ViewName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfo + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfo + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert#Multiple - - - - + - - - - - - BlobLink - - - ByteCount - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsOperationResults - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsOperationResults - - - - - - - - - - - - - - Name - - - Status - - - ValidTill - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriod - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriod - - - - - - - - - - - - - - - End - - - Start - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition - - - - - - - - - - - - - - - - - - BillingPeriod - - - InvoiceId - - - Metric - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifest - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifest - - - - - - - - - - - - - - - - - - - - - - - - BlobCount - - - ByteCount - - - CompressData - - - DataFormat - - - ManifestVersion - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContext - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContext - - - - - - - - - - - - RequestScope - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Alert - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Alert - - - - - - - - + @@ -286,15 +27,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties#Multiple @@ -362,9 +106,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinition#Multiple @@ -390,9 +134,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetails + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetails - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetails + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetails#Multiple @@ -402,15 +146,6 @@ - - - - - - - - - @@ -429,9 +164,6 @@ - - - @@ -441,12 +173,6 @@ - - - - - - @@ -469,15 +195,6 @@ CompanyName - - ContactEmail - - - ContactGroup - - - ContactRole - CurrentSpend @@ -496,9 +213,6 @@ InvoicingThreshold - - MeterFilter - Operator @@ -508,12 +222,6 @@ PeriodStartDate - - ResourceFilter - - - ResourceGroupFilter - Threshold @@ -532,9 +240,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertsResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertsResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult#Multiple @@ -554,33 +262,199 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfo - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfo#Multiple - + + + + + + + + + + + BlobLink + + + ByteCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties#Multiple + + + + + + + + + + + + + + + + + + Format + + + NextRunTimeEstimate + + + PartitionData + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults#Multiple + + + + + + + + + + + + + + + + + + + + + Name + + + ResourceGroupName + + + Status + + + ValidTill + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriod#Multiple + + + + + + + + + + + + + + + End + + + Start + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostManagementIdentity + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostManagementIdentity#Multiple + + + + + + + + - + - + + + + + + + + + + + + + + + + - Format + AlertId - NextRunTimeEstimate + BillingAccountId - PartitionData + BillingProfileId + + + ExportName + + + ExternalCloudProviderId + + + ExternalCloudProviderType + + + OperationId + + + Scope + + + ViewName @@ -588,9 +462,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Dimension + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Dimension + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Dimension#Multiple @@ -628,18 +502,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionProperties#Multiple - - - @@ -668,9 +539,6 @@ Category - - Data - Description @@ -698,9 +566,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails#Multiple @@ -726,9 +594,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export#Multiple @@ -738,6 +606,9 @@ + + + @@ -748,27 +619,8 @@ Name - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDataset - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDataset - - - - - - - - - - - Granularity + ResourceGroupName @@ -776,21 +628,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDataset#Multiple - + - Column + Granularity @@ -798,9 +650,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinition#Multiple @@ -820,9 +672,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestination + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestination + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestination#Multiple @@ -866,9 +718,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecution + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecution - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecution + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecution#Multiple @@ -912,9 +764,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionProperties#Multiple @@ -970,15 +822,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportProperties#Multiple - - - @@ -1022,9 +871,6 @@ - - ConfigurationColumn - DataSetGranularity @@ -1070,9 +916,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriod#Multiple @@ -1098,9 +944,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportSchedule + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportSchedule - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportSchedule + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportSchedule#Multiple @@ -1126,9 +972,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriod#Multiple @@ -1154,9 +1000,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastAggregation - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastAggregation#Multiple @@ -1182,9 +1028,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumn + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumn - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumn + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumn#Multiple @@ -1204,9 +1050,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression#Multiple @@ -1216,9 +1062,6 @@ - - - @@ -1229,18 +1072,15 @@ Operator - - Value - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDataset#Multiple @@ -1260,31 +1100,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfiguration - - - - - - - - - - - - Column - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDefinition#Multiple @@ -1316,9 +1134,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastProperties#Multiple @@ -1338,9 +1156,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult#Multiple @@ -1356,6 +1174,9 @@ + + + @@ -1372,15 +1193,18 @@ Sku + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriod#Multiple @@ -1406,9 +1230,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition#Multiple + + + + + + + + + + + + + + + + + + BillingPeriod + + + InvoiceId + + + Metric + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiProperties#Multiple @@ -1428,9 +1286,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Operation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Operation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Operation#Multiple @@ -1450,9 +1308,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplay#Multiple @@ -1490,9 +1348,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationListResult#Multiple @@ -1512,9 +1370,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationStatus + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationStatus + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus#Multiple @@ -1534,9 +1392,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotProperties#Multiple @@ -1556,9 +1414,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource#Multiple @@ -1584,9 +1442,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryAggregation - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryAggregation#Multiple @@ -1612,9 +1470,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumn + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumn - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumn + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumn#Multiple @@ -1634,9 +1492,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression#Multiple @@ -1646,9 +1504,6 @@ - - - @@ -1659,18 +1514,15 @@ Operator - - Value - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDataset#Multiple @@ -1690,31 +1542,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfiguration - - - - - - - - - - - - Column - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDefinition#Multiple @@ -1734,9 +1564,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGrouping + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGrouping - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGrouping + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGrouping#Multiple @@ -1756,18 +1586,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryProperties#Multiple - - - @@ -1775,18 +1602,15 @@ NextLink - - Row - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult#Multiple @@ -1812,9 +1636,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriod#Multiple @@ -1840,9 +1664,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigAggregation - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigAggregation + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigAggregation#Multiple @@ -1868,9 +1692,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression#Multiple @@ -1880,9 +1704,6 @@ - - - @@ -1893,18 +1714,15 @@ Operator - - Value - - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDataset + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDataset#Multiple @@ -1924,21 +1742,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinition#Multiple - + + + + - Column + IncludeMonetaryCommitment + + + Timeframe @@ -1946,27 +1770,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGrouping - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGrouping#Multiple - - - - + - IncludeMonetaryCommitment - - - Timeframe + Name @@ -1974,12 +1792,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGrouping + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSorting - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGrouping + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSorting#Multiple + + + @@ -1987,6 +1808,9 @@ + + Direction + Name @@ -1996,27 +1820,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSorting + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSorting + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriod#Multiple - + - + - Direction + From - Name + To @@ -2024,27 +1848,45 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifest - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifest#Multiple - + - + + + + + + + + + + - From + BlobCount - To + ByteCount + + + CompressData + + + DataFormat + + + ManifestVersion @@ -2052,9 +1894,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrl + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrl - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrl + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrl#Multiple @@ -2080,9 +1922,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContext + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContext#Multiple + + + + + + + + + + + + RequestScope + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource#Multiple @@ -2120,9 +1984,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags#Multiple @@ -2142,9 +2006,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View#Multiple @@ -2154,6 +2018,9 @@ + + + @@ -2164,15 +2031,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewListResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewListResult + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult#Multiple @@ -2192,9 +2062,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewProperties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewProperties + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewProperties#Multiple diff --git a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.psd1 b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.psd1 index 5f283c22562d..3845f5eb2d06 100644 --- a/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.psd1 +++ b/generated/CostManagement/CostManagement.Autorest/Az.CostManagement.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.CostManagement.private.dll' FormatsToProcess = './Az.CostManagement.format.ps1xml' - FunctionsToExport = 'Get-AzCostManagementExport', 'Get-AzCostManagementExportExecutionHistory', 'Invoke-AzCostManagementExecuteExport', 'Invoke-AzCostManagementQuery', 'Invoke-AzCostManagementReservationDetailReport', 'New-AzCostManagementDetailReport', 'New-AzCostManagementExport', 'New-AzCostManagementQueryComparisonExpressionObject', 'New-AzCostManagementQueryFilterObject', 'Remove-AzCostManagementExport', 'Update-AzCostManagementExport', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzCostManagementExport', 'Get-AzCostManagementExportExecutionHistory', 'Invoke-AzCostManagementExecuteExport', 'Invoke-AzCostManagementQuery', 'Invoke-AzCostManagementReservationDetailReport', 'New-AzCostManagementDetailReport', 'New-AzCostManagementExport', 'New-AzCostManagementQueryComparisonExpressionObject', 'New-AzCostManagementQueryFilterObject', 'Remove-AzCostManagementExport', 'Update-AzCostManagementExport' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Cost' diff --git a/generated/CostManagement/CostManagement.Autorest/Properties/AssemblyInfo.cs b/generated/CostManagement/CostManagement.Autorest/Properties/AssemblyInfo.cs index 0d69813674a4..27ba54fbf85d 100644 --- a/generated/CostManagement/CostManagement.Autorest/Properties/AssemblyInfo.cs +++ b/generated/CostManagement/CostManagement.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - CostManagement")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("de963dfc-d256-4077-8836-2ae5079a43e7")] -[assembly: AssemblyVersion("0.3.4")] -[assembly: AssemblyFileVersion("0.3.4")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - CostManagement")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/CostManagement/CostManagement.Autorest/check-dependencies.ps1 b/generated/CostManagement/CostManagement.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/CostManagement/CostManagement.Autorest/check-dependencies.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExport.ps1 index f3622d3de60f..6f2634875483 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExport.ps1 @@ -27,7 +27,9 @@ Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -39,16 +41,18 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Get-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport], [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -69,7 +73,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -135,6 +138,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,6 +177,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExportExecutionHistory.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExportExecutionHistory.ps1 index d9d17ec4f625..3be8a4158fdc 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExportExecutionHistory.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Get-AzCostManagementExportExecutionHistory.ps1 @@ -28,7 +28,7 @@ Get-AzCostManagementExportExecutionHistory -InputObject $getExport .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -40,16 +40,18 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementexportexecutionhistory +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Get-AzCostManagementExportExecutionHistory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -68,7 +70,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -127,6 +128,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,6 +166,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementExecuteExport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementExecuteExport.ps1 index ad54da1f58a7..aa2af668eda3 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementExecuteExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementExecuteExport.ps1 @@ -40,13 +40,15 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementexecuteexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Invoke-AzCostManagementExecuteExport { [OutputType([System.Boolean])] @@ -68,7 +70,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +134,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,6 +172,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementQuery.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementQuery.ps1 index e99f3be82874..76b1fcf5b02c 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementQuery.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementQuery.ps1 @@ -27,29 +27,34 @@ $filter = New-AzCostManagementQueryFilterObject -Dimensions $dimensions Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/***********" -DatasetGranularity 'Monthly' -DatasetFilter $filter -Timeframe MonthToDate -Debug .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. DATASETFILTER : Has filter expression to use in the query. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag DATASETGROUPING : Array of group by expression to use in the query. Name : The name of the column to group. - Type : Has type of the column to group. + Type : Has type of the column to group. .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementquery #> function Invoke-AzCostManagementQuery { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult])] [CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UsageExpanded', Mandatory)] @@ -65,23 +70,23 @@ param( ${ExternalCloudProviderId}, [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ExternalBillingAccounts", "ExternalSubscriptions")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType] + [System.String] # The external cloud provider type associated with dimension/query operations. ${ExternalCloudProviderType}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the query. ${Timeframe}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # The type of the query. ${Type}, @@ -93,30 +98,28 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation]))] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation]))] [System.Collections.Hashtable] # Dictionary of aggregation expression to use in the query. ${DatasetAggregation}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter] # Has filter expression to use in the query. - # To construct, see NOTES section for DATASETFILTER properties and create a hash table. ${DatasetFilter}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the query. ${DatasetGranularity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping[]] # Array of group by expression to use in the query. - # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. ${DatasetGrouping}, [Parameter()] @@ -186,6 +189,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -215,6 +227,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementReservationDetailReport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementReservationDetailReport.ps1 index 9d2262eab524..ef3b55faa8e0 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementReservationDetailReport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Invoke-AzCostManagementReservationDetailReport.ps1 @@ -27,12 +27,14 @@ For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-m Invoke-AzCostManagementReservationDetailReport -BillingAccountId "00000000-0000-0000-0000-0000000000" -StartDate "2022-10-01" -EndDate "2022-10-20" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementreservationdetailreport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Invoke-AzCostManagementReservationDetailReport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus])] [CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -127,6 +129,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,6 +167,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementDetailReport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementDetailReport.ps1 index 2c05e55a83f9..df2110c03602 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementDetailReport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementDetailReport.ps1 @@ -37,12 +37,14 @@ The details on the file(s) available for download will be available in the polli New-AzCostManagementDetailReport -Scope "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Metric 'ActualCost' -TimePeriodStart "2022-10-01" -TimePeriodEnd "2022-10-20" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementdetailreport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function New-AzCostManagementDetailReport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -53,7 +55,7 @@ param( # Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # This parameter can be used only by Enterprise Agreement customers. @@ -63,7 +65,7 @@ param( # If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. ${BillingPeriod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # This parameter can only be used by Microsoft Customer Agreement customers. @@ -72,28 +74,40 @@ param( # If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. ${InvoiceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType] + [System.String] # The type of the detailed report. # By default ActualCost is provided ${Metric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The end date to pull data to. # example format 2020-03-15 ${TimePeriodEnd}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The start date to pull data from. # example format 2020-03-15 ${TimePeriodStart}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -162,6 +176,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,6 +205,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -190,6 +215,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementExport.ps1 index b61cdc1254d3..355d0d51e640 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementExport.ps1 @@ -29,12 +29,12 @@ Create operation does not require eTag. New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementexport #> function New-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -50,7 +50,7 @@ param( # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] # Array of column names to be included in the export. @@ -58,101 +58,147 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. + # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. + # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # A SAS token for the storage account. + # For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. + # Note: the value returned by the API for this property will always be obfuscated. + # Returning this same obfuscated value will not result in the SAS token being updated. + # To update this value a new SAS token must be specified. + ${DestinationSasToken}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The storage account where exports will be uploaded. + # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. + ${DestinationStorageAccount}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] + # 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. + ${ETag}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.Management.Automation.SwitchParameter] + # 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 modern commerce scopes. + ${PartitionData}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -202,6 +248,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -222,6 +277,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.CostManagement.custom\New-AzCostManagementExport'; + CreateViaJsonFilePath = 'Az.CostManagement.custom\New-AzCostManagementExport'; + CreateViaJsonString = 'Az.CostManagement.custom\New-AzCostManagementExport'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -230,6 +287,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryComparisonExpressionObject.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryComparisonExpressionObject.ps1 index 8300d637a0c4..a64442d629e2 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryComparisonExpressionObject.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryComparisonExpressionObject.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a in-memory object for QueryComparisonExpression +Create an in-memory object for QueryComparisonExpression. .Description -Create a in-memory object for QueryComparisonExpression +Create an in-memory object for QueryComparisonExpression. .Example New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Value @('East US', 'West Europe') .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression .Link -https://learn.microsoft.com/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject +https://learn.microsoft.com/powershell/module/Az.CostManagement/new-azcostmanagementquerycomparisonexpressionobject #> function New-AzCostManagementQueryComparisonExpressionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -37,12 +37,6 @@ param( # The name of the column to use in comparison. ${Name}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType] - # The operator to use for comparison. - ${Operator}, - [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -57,6 +51,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -85,6 +82,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryFilterObject.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryFilterObject.ps1 index 96435712eab3..b1b1bb26826d 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryFilterObject.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/New-AzCostManagementQueryFilterObject.ps1 @@ -16,97 +16,107 @@ <# .Synopsis -Create a in-memory object for QueryFilter +Create an in-memory object for QueryFilter. .Description -Create a in-memory object for QueryFilter +Create an in-memory object for QueryFilter. .Example $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Value @('East US', 'West Europe') $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Value @('UAT', 'Prod') New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimensions $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. AND : The logical "AND" expression. Must have at least 2 items. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag -DIMENSIONS : Has comparison expression for a dimensions. +DIMENSIONS : Has comparison expression for a dimension. Name : The name of the column to use in comparison. - Value : Array of values to use for comparison + Value >: Array of values to use for comparison NOT : The logical "NOT" expression. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag OR : The logical "OR" expression. Must have at least 2 items. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag TAG : Has comparison expression for a tag. Name : The name of the column to use in comparison. - Value : Array of values to use for comparison + Value >: Array of values to use for comparison .Link -https://learn.microsoft.com/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject +https://learn.microsoft.com/powershell/module/Az.CostManagement/new-azcostmanagementqueryfilterobject #> function New-AzCostManagementQueryFilterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter[]] # The logical "AND" expression. # Must have at least 2 items. - # To construct, see NOTES section for AND properties and create a hash table. ${And}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression] - # Has comparison expression for a dimensions. - # To construct, see NOTES section for DIMENSIONS properties and create a hash table. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression] + # Has comparison expression for a dimension. ${Dimensions}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter] # The logical "NOT" expression. - # To construct, see NOTES section for NOT properties and create a hash table. ${Not}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter[]] # The logical "OR" expression. # Must have at least 2 items. - # To construct, see NOTES section for OR properties and create a hash table. ${Or}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression] # Has comparison expression for a tag. - # To construct, see NOTES section for TAG properties and create a hash table. ${Tag} ) @@ -117,6 +127,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -145,6 +158,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/ProxyCmdletDefinitions.ps1 index ae89920ce601..f615edb3ef33 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -28,7 +28,7 @@ Get-AzCostManagementExportExecutionHistory -InputObject $getExport .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -40,16 +40,18 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementexportexecutionhistory +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Get-AzCostManagementExportExecutionHistory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -68,7 +70,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -127,6 +128,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,6 +166,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -212,7 +225,9 @@ Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -224,16 +239,18 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Get-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport], [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -254,7 +271,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -320,6 +336,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -350,6 +375,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -419,13 +447,15 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementexecuteexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Invoke-AzCostManagementExecuteExport { [OutputType([System.Boolean])] @@ -447,7 +477,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -512,6 +541,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -541,6 +579,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -597,12 +638,14 @@ For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-m Invoke-AzCostManagementReservationDetailReport -BillingAccountId "00000000-0000-0000-0000-0000000000" -StartDate "2022-10-01" -EndDate "2022-10-20" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementreservationdetailreport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Invoke-AzCostManagementReservationDetailReport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus])] [CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -697,6 +740,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -726,6 +778,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -792,12 +847,14 @@ The details on the file(s) available for download will be available in the polli New-AzCostManagementDetailReport -Scope "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Metric 'ActualCost' -TimePeriodStart "2022-10-01" -TimePeriodEnd "2022-10-20" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementdetailreport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function New-AzCostManagementDetailReport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -808,7 +865,7 @@ param( # Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # This parameter can be used only by Enterprise Agreement customers. @@ -818,7 +875,7 @@ param( # If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. ${BillingPeriod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # This parameter can only be used by Microsoft Customer Agreement customers. @@ -827,28 +884,40 @@ param( # If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. ${InvoiceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType] + [System.String] # The type of the detailed report. # By default ActualCost is provided ${Metric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The end date to pull data to. # example format 2020-03-15 ${TimePeriodEnd}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The start date to pull data from. # example format 2020-03-15 ${TimePeriodStart}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -917,6 +986,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -937,6 +1015,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.CostManagement.private\New-AzCostManagementDetailReport_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -945,6 +1025,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1014,13 +1097,15 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/remove-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Remove-AzCostManagementExport { [OutputType([System.Boolean])] @@ -1043,7 +1128,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1108,6 +1192,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1137,6 +1230,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1193,29 +1289,34 @@ $filter = New-AzCostManagementQueryFilterObject -Dimensions $dimensions Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/***********" -DatasetGranularity 'Monthly' -DatasetFilter $filter -Timeframe MonthToDate -Debug .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. DATASETFILTER : Has filter expression to use in the query. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag DATASETGROUPING : Array of group by expression to use in the query. Name : The name of the column to group. - Type : Has type of the column to group. + Type : Has type of the column to group. .Link https://learn.microsoft.com/powershell/module/az.costmanagement/invoke-azcostmanagementquery #> function Invoke-AzCostManagementQuery { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult])] [CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UsageExpanded', Mandatory)] @@ -1231,23 +1332,23 @@ param( ${ExternalCloudProviderId}, [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ExternalBillingAccounts", "ExternalSubscriptions")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType] + [System.String] # The external cloud provider type associated with dimension/query operations. ${ExternalCloudProviderType}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the query. ${Timeframe}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # The type of the query. ${Type}, @@ -1259,30 +1360,28 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation]))] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation]))] [System.Collections.Hashtable] # Dictionary of aggregation expression to use in the query. ${DatasetAggregation}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter] # Has filter expression to use in the query. - # To construct, see NOTES section for DATASETFILTER properties and create a hash table. ${DatasetFilter}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the query. ${DatasetGranularity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping[]] # Array of group by expression to use in the query. - # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. ${DatasetGrouping}, [Parameter()] @@ -1352,6 +1451,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1381,6 +1489,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1439,12 +1550,12 @@ Create operation does not require eTag. New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementexport #> function New-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1460,7 +1571,7 @@ param( # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] # Array of column names to be included in the export. @@ -1468,101 +1579,147 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. + # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. + # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] + # A SAS token for the storage account. + # For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. + # Note: the value returned by the API for this property will always be obfuscated. + # Returning this same obfuscated value will not result in the SAS token being updated. + # To update this value a new SAS token must be specified. + ${DestinationSasToken}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The storage account where exports will be uploaded. + # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. + ${DestinationStorageAccount}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # 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. + ${ETag}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.Management.Automation.SwitchParameter] + # 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 modern commerce scopes. + ${PartitionData}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1612,6 +1769,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1632,6 +1798,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.CostManagement.custom\New-AzCostManagementExport'; + CreateViaJsonFilePath = 'Az.CostManagement.custom\New-AzCostManagementExport'; + CreateViaJsonString = 'Az.CostManagement.custom\New-AzCostManagementExport'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1640,6 +1808,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1685,19 +1856,19 @@ end { <# .Synopsis -Create a in-memory object for QueryComparisonExpression +Create an in-memory object for QueryComparisonExpression. .Description -Create a in-memory object for QueryComparisonExpression +Create an in-memory object for QueryComparisonExpression. .Example New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Value @('East US', 'West Europe') .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression .Link -https://learn.microsoft.com/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject +https://learn.microsoft.com/powershell/module/Az.CostManagement/new-azcostmanagementquerycomparisonexpressionobject #> function New-AzCostManagementQueryComparisonExpressionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1706,12 +1877,6 @@ param( # The name of the column to use in comparison. ${Name}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType] - # The operator to use for comparison. - ${Operator}, - [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -1726,6 +1891,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1754,6 +1922,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1799,97 +1970,107 @@ end { <# .Synopsis -Create a in-memory object for QueryFilter +Create an in-memory object for QueryFilter. .Description -Create a in-memory object for QueryFilter +Create an in-memory object for QueryFilter. .Example $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Value @('East US', 'West Europe') $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Value @('UAT', 'Prod') New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimensions $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. AND : The logical "AND" expression. Must have at least 2 items. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag -DIMENSIONS : Has comparison expression for a dimensions. +DIMENSIONS : Has comparison expression for a dimension. Name : The name of the column to use in comparison. - Value : Array of values to use for comparison + Value >: Array of values to use for comparison NOT : The logical "NOT" expression. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag OR : The logical "OR" expression. Must have at least 2 items. - [And ]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [And >]: The logical "AND" expression. Must have at least 2 items. + [Dimensions ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Value >: Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or >]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag [Dimensions ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Value : Array of values to use for comparison [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. + [Or >]: The logical "OR" expression. Must have at least 2 items. [Tag ]: Has comparison expression for a tag TAG : Has comparison expression for a tag. Name : The name of the column to use in comparison. - Value : Array of values to use for comparison + Value >: Array of values to use for comparison .Link -https://learn.microsoft.com/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject +https://learn.microsoft.com/powershell/module/Az.CostManagement/new-azcostmanagementqueryfilterobject #> function New-AzCostManagementQueryFilterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter[]] # The logical "AND" expression. # Must have at least 2 items. - # To construct, see NOTES section for AND properties and create a hash table. ${And}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression] - # Has comparison expression for a dimensions. - # To construct, see NOTES section for DIMENSIONS properties and create a hash table. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression] + # Has comparison expression for a dimension. ${Dimensions}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter] # The logical "NOT" expression. - # To construct, see NOTES section for NOT properties and create a hash table. ${Not}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter[]] # The logical "OR" expression. # Must have at least 2 items. - # To construct, see NOTES section for OR properties and create a hash table. ${Or}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression] # Has comparison expression for a tag. - # To construct, see NOTES section for TAG properties and create a hash table. ${Tag} ) @@ -1900,6 +2081,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1928,6 +2112,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1991,7 +2178,7 @@ Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekl .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Notes COMPLEX PARAMETER PROPERTIES @@ -2003,7 +2190,7 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. @@ -2012,10 +2199,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.costmanagement/update-azcostmanagementexport #> function Update-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ExportName')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] @@ -2023,6 +2212,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. @@ -2032,10 +2223,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] # Array of column names to be included in the export. @@ -2043,108 +2234,164 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. + # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. + # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # A SAS token for the storage account. + # For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. + # Note: the value returned by the API for this property will always be obfuscated. + # Returning this same obfuscated value will not result in the SAS token being updated. + # To update this value a new SAS token must be specified. + ${DestinationSasToken}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The storage account where exports will be uploaded. + # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. + ${DestinationStorageAccount}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.Management.Automation.SwitchParameter] + # 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 modern commerce scopes. + ${PartitionData}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2194,6 +2441,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2214,6 +2470,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.CostManagement.custom\Update-AzCostManagementExport'; + UpdateViaJsonString = 'Az.CostManagement.custom\Update-AzCostManagementExport'; + UpdateViaJsonFilePath = 'Az.CostManagement.custom\Update-AzCostManagementExport'; UpdateViaIdentityExpanded = 'Az.CostManagement.custom\Update-AzCostManagementExport'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -2223,6 +2481,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Remove-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Remove-AzCostManagementExport.ps1 index b82d9c0343b2..a40f688b9469 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Remove-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Remove-AzCostManagementExport.ps1 @@ -40,13 +40,15 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/remove-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Remove-AzCostManagementExport { [OutputType([System.Boolean])] @@ -69,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +135,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,6 +173,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/exports/Update-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/exports/Update-AzCostManagementExport.ps1 index d3b3a9a7d52c..0435996d8ca3 100644 --- a/generated/CostManagement/CostManagement.Autorest/exports/Update-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/exports/Update-AzCostManagementExport.ps1 @@ -34,7 +34,7 @@ Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekl .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. @@ -55,10 +55,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.costmanagement/update-azcostmanagementexport #> function Update-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ExportName')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] @@ -66,6 +68,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. @@ -75,10 +79,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] # Array of column names to be included in the export. @@ -86,108 +90,164 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. + # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. + # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # A SAS token for the storage account. + # For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. + # Note: the value returned by the API for this property will always be obfuscated. + # Returning this same obfuscated value will not result in the SAS token being updated. + # To update this value a new SAS token must be specified. + ${DestinationSasToken}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The storage account where exports will be uploaded. + # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. + ${DestinationStorageAccount}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.Management.Automation.SwitchParameter] + # 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 modern commerce scopes. + ${PartitionData}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -237,6 +297,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -257,6 +326,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.CostManagement.custom\Update-AzCostManagementExport'; + UpdateViaJsonString = 'Az.CostManagement.custom\Update-AzCostManagementExport'; + UpdateViaJsonFilePath = 'Az.CostManagement.custom\Update-AzCostManagementExport'; UpdateViaIdentityExpanded = 'Az.CostManagement.custom\Update-AzCostManagementExport'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -266,6 +337,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/generate-info.json b/generated/CostManagement/CostManagement.Autorest/generate-info.json index 2d6fd9583922..1b80ac355527 100644 --- a/generated/CostManagement/CostManagement.Autorest/generate-info.json +++ b/generated/CostManagement/CostManagement.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "71b8e822-9738-44ac-8ea3-fdc00d01f633" + "generate_Id": "f708438f-fa63-49df-ae51-3811bffb58b4" } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/Module.cs b/generated/CostManagement/CostManagement.Autorest/generated/Module.cs index b0ed5665a14d..edeeada5cab1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/Module.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module public string Name => @"Az.CostManagement"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Cr /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/CostManagement.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/CostManagement.cs index 5f846761a99d..5bd2f3561d31 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/CostManagement.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/CostManagement.cs @@ -30,10 +30,11 @@ public partial class CostManagement /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsDismiss(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsDismiss(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -58,11 +59,11 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AlertsDismiss_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsDismiss_Call (request, onOk,onDefault,eventListener,sender); } } @@ -74,10 +75,11 @@ public partial class CostManagement /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsDismissViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsDismissViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -113,67 +115,69 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AlertsDismiss_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsDismiss_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Dismisses the specified alert + /// + /// Parameters supplied to the Dismiss Alert operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsDismiss_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsDismissViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var alertId = _match.Groups["alertId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/alerts/" + + alertId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AlertsDismissWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Dismisses the specified alert /// 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}' @@ -184,23 +188,49 @@ public partial class CostManagement /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. /// Alert ID - /// Parameters supplied to the Dismiss Alert operation. + /// Json string supplied to the AlertsDismiss operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsDismiss_Validate(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task AlertsDismissViaJsonString(string scope, string alertId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(alertId),alertId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/alerts/" + + (alertId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsDismiss_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the alert for the scope by alert ID. + /// Dismisses the specified alert /// 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}' @@ -211,15 +241,14 @@ public partial class CostManagement /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. /// Alert ID - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the AlertsDismiss operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsGet(string scope, string alertId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsDismissViaJsonStringWithResult(string scope, string alertId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -235,70 +264,136 @@ public partial class CostManagement + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AlertsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.AlertsDismissWithResult_Call (request, eventListener,sender); } } - /// Gets the alert for the scope by alert ID. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Dismisses the specified alert + /// 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. + /// Alert ID + /// Parameters supplied to the Dismiss Alert operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsDismissWithResult(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var alertId = _match.Groups["alertId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.CostManagement/alerts/" - + alertId + + (alertId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AlertsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.AlertsDismissWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsDismissWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -308,7 +403,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsDismiss_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -319,6 +414,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -326,13 +422,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -348,8 +444,8 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// 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}' @@ -361,20 +457,23 @@ public partial class CostManagement /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. /// Alert ID + /// Parameters supplied to the Dismiss Alert operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsGet_Validate(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AlertsDismiss_Validate(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); await eventListener.AssertNotNull(nameof(alertId),alertId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists the alerts for scope defined. + /// Gets the alert for the scope by alert ID. /// 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}' @@ -384,6 +483,7 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. + /// Alert ID /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -392,7 +492,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsList(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsGet(string scope, string alertId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -402,7 +502,8 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.CostManagement/alerts" + + "/providers/Microsoft.CostManagement/alerts/" + + (alertId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -416,15 +517,12 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AlertsList_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists the Alerts for external cloud provider type defined. - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. + /// Gets the alert for the scope by alert ID. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -433,19 +531,29 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsListExternal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var alertId = _match.Groups["alertId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + global::System.Uri.EscapeDataString(externalCloudProviderType) - + "/" - + global::System.Uri.EscapeDataString(externalCloudProviderId) - + "/alerts" + "/" + + scope + + "/providers/Microsoft.CostManagement/alerts/" + + alertId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -459,21 +567,19 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AlertsListExternal_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists the Alerts for external cloud provider type defined. + /// Gets the alert for the scope by alert ID. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AlertsListExternalViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -481,50 +587,93 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'"); } // replace URI parameters with values from identity - var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; - var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + var scope = _match.Groups["scope"].Value; + var alertId = _match.Groups["alertId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + externalCloudProviderType - + "/" - + externalCloudProviderId - + "/alerts" + "/" + + scope + + "/providers/Microsoft.CostManagement/alerts/" + + alertId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AlertsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the alert for the scope by alert ID. + /// 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. + /// Alert ID + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsGetWithResult(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/alerts/" + + (alertId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AlertsListExternal_Call(request,onOk,onDefault,eventListener,sender); + return await this.AlertsGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsListExternal_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -532,24 +681,37 @@ public partial class CostManagement try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -563,77 +725,7 @@ public partial class CostManagement } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task AlertsListExternal_Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); - await eventListener.AssertEnum(nameof(externalCloudProviderType),externalCloudProviderType,@"externalSubscriptions", @"externalBillingAccounts"); - await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); - } - } - - /// Lists the alerts for scope defined. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task AlertsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-10-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/alerts" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.AlertsList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -643,7 +735,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -654,6 +746,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -661,13 +754,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -683,7 +776,7 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get validation events + /// Validation method for method. Call this like the actual call, but you will get validation events /// back. /// /// The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for @@ -695,31 +788,71 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. + /// Alert ID /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AlertsList_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AlertsGet_Validate(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(alertId),alertId); } } - /// Lists the dimensions by the external cloud provider type. + /// Lists the alerts for scope defined. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsList(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the Alerts for external cloud provider type defined. /// The external cloud provider type associated with dimension/query operations. This /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' /// for consolidated account used with dimension/query operations. - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -728,7 +861,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListExternal(string externalCloudProviderType, string externalCloudProviderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -740,17 +873,9 @@ public partial class CostManagement + global::System.Uri.EscapeDataString(externalCloudProviderType) + "/" + global::System.Uri.EscapeDataString(externalCloudProviderId) - + "/dimensions" + + "/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" - + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) - + "&" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -762,20 +887,12 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DimensionsByExternalCloudProviderType_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsListExternal_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists the dimensions by the external cloud provider type. + /// Lists the Alerts for external cloud provider type defined. /// - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -784,7 +901,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderTypeViaIdentity(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListExternalViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -792,10 +909,10 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'"); } // replace URI parameters with values from identity @@ -807,17 +924,9 @@ public partial class CostManagement + externalCloudProviderType + "/" + externalCloudProviderId - + "/dimensions" + + "/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" - + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) - + "&" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -829,124 +938,71 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DimensionsByExternalCloudProviderType_Call(request,onOk,onDefault,eventListener,sender); + await this.AlertsListExternal_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists the Alerts for external cloud provider type defined. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListExternalViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'"); } - } + + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AlertsListExternalWithResult_Call (request, eventListener,sender); + } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// Lists the Alerts for external cloud provider type defined. /// The external cloud provider type associated with dimension/query operations. This /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' /// for consolidated account used with dimension/query operations. - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType_Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); - await eventListener.AssertEnum(nameof(externalCloudProviderType),externalCloudProviderType,@"externalSubscriptions", @"externalBillingAccounts"); - await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(Expand),Expand); - await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); - await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); - await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); - } - } - - /// Lists the dimensions by the defined scope. - /// The scope associated with dimension 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.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. - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DimensionsList(string scope, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListExternalWithResult(string externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -954,103 +1010,91 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (scope) - + "/providers/Microsoft.CostManagement/dimensions" + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" - + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) - + "&" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DimensionsList_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.AlertsListExternalWithResult_Call (request, eventListener,sender); } } - /// Lists the dimensions by the defined scope. - /// - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DimensionsListViaIdentity(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsListExternalWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2021-10-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/dimensions'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/dimensions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" - + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) - + "&" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.DimensionsList_Call(request,onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1058,7 +1102,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DimensionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsListExternal_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1069,6 +1113,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1076,19 +1121,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1104,60 +1143,29 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// The scope associated with dimension 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.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. - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. - /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included - /// when listing dimensions. - /// 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. - /// May be used to limit the number of results to the most recent N dimension data. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DimensionsList_Validate(string scope, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AlertsListExternal_Validate(string externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(Expand),Expand); - await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); - await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); - await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); + await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); + await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); } } - /// - /// The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. - /// To obtain the latest eTag for a given export, perform a get operation prior to your put operation. - /// - /// 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. - /// Export Name. - /// Parameters supplied to the CreateOrUpdate Export operation. + /// Lists the alerts for scope defined. + /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1165,18 +1173,27 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsCreateOrUpdate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.CostManagement/exports/" - + global::System.Uri.EscapeDataString(exportName) + + scope + + "/providers/Microsoft.CostManagement/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1185,35 +1202,24 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.AlertsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. - /// To obtain the latest eTag for a given export, perform a get operation prior to your put operation. - /// + /// Lists the alerts for scope defined. /// - /// Parameters supplied to the CreateOrUpdate Export operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -1221,130 +1227,38 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/alerts'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.CostManagement/exports/" - + exportName + + "/providers/Microsoft.CostManagement/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ExportsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// 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. - /// Export Name. - /// Parameters supplied to the CreateOrUpdate Export operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ExportsCreateOrUpdate_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(exportName),exportName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + return await this.AlertsListWithResult_Call (request, eventListener,sender); } } - /// The operation to delete a export. - /// The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + /// Lists the alerts for scope defined. + /// 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}' @@ -1353,16 +1267,13 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Export Name. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsDelete(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AlertsListWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -1372,76 +1283,85 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.CostManagement/exports/" - + global::System.Uri.EscapeDataString(exportName) + + "/providers/Microsoft.CostManagement/alerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportsDelete_Call(request,onOk,onDefault,eventListener,sender); + return await this.AlertsListWithResult_Call (request, eventListener,sender); } } - /// The operation to delete a export. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2021-10-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var exportName = _match.Groups["exportName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/exports/" - + exportName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ExportsDelete_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1451,7 +1371,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AlertsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1462,6 +1382,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1469,13 +1390,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1491,10 +1412,10 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. /// - /// The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for + /// 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}' @@ -1503,31 +1424,31 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Export Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsDelete_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AlertsList_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(exportName),exportName); } } - /// The operation to execute an export. - /// 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. - /// Export Name. + /// Lists the dimensions by the external cloud provider type. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1536,7 +1457,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsExecute(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType(string externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -1544,30 +1465,46 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (scope) - + "/providers/Microsoft.CostManagement/exports/" - + global::System.Uri.EscapeDataString(exportName) - + "/run" + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportsExecute_Call(request,onOk,onDefault,eventListener,sender); + await this.DimensionsByExternalCloudProviderType_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to execute an export. + /// Lists the dimensions by the external cloud provider type. /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1576,7 +1513,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsExecuteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderTypeViaIdentity(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -1584,189 +1521,132 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'"); } // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var exportName = _match.Groups["exportName"].Value; + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/exports/" - + exportName - + "/run" + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportsExecute_Call(request,onOk,onDefault,eventListener,sender); + await this.DimensionsByExternalCloudProviderType_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists the dimensions by the external cloud provider type. + /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsExecute_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderTypeViaIdentityWithResult(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// 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. - /// Export Name. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ExportsExecute_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(exportName),exportName); - } - } - /// The operation to get the export for the defined scope by export name. - /// 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. - /// Export Name. - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last 10 executions of the export. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ExportsGet(string scope, string exportName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-10-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (scope) - + "/providers/Microsoft.CostManagement/exports/" - + global::System.Uri.EscapeDataString(exportName) + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.DimensionsByExternalCloudProviderTypeWithResult_Call (request, eventListener,sender); } } - /// - /// The operation to get the execution history of an export for the defined scope and export name. - /// - /// 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. - /// Export Name. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists the dimensions by the external cloud provider type. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsGetExecutionHistory(string scope, string exportName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderTypeWithResult(string externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -1774,82 +1654,101 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (scope) - + "/providers/Microsoft.CostManagement/exports/" - + global::System.Uri.EscapeDataString(exportName) - + "/runHistory" + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportsGetExecutionHistory_Call(request,onOk,onDefault,eventListener,sender); + return await this.DimensionsByExternalCloudProviderTypeWithResult_Call (request, eventListener,sender); } } /// - /// The operation to get the execution history of an export for the defined scope and export name. + /// Actual wire call for method. /// - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsGetExecutionHistoryViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderTypeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2021-10-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var exportName = _match.Groups["exportName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/exports/" - + exportName - + "/runHistory" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ExportsGetExecutionHistory_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1859,7 +1758,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsGetExecutionHistory_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1870,6 +1769,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1877,13 +1777,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1899,37 +1799,59 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// 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. - /// Export Name. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsGetExecutionHistory_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DimensionsByExternalCloudProviderType_Validate(string externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(exportName),exportName); + await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); + await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); } } - /// The operation to get the export for the defined scope by export name. - /// - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last 10 executions of the export. + /// Lists the dimensions by the defined scope. + /// The scope associated with dimension 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.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. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1937,33 +1859,27 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsList(string scope, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.CostManagement/exports/" - + exportName + + (scope) + + "/providers/Microsoft.CostManagement/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -1975,13 +1891,22 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DimensionsList_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Lists the dimensions by the defined scope. + /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1989,110 +1914,37 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsListViaIdentity(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/dimensions'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// 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. - /// Export Name. - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last 10 executions of the export. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ExportsGet_Validate(string scope, string exportName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(exportName),exportName); - await eventListener.AssertNotNull(nameof(Expand),Expand); - } - } - /// The operation to list all exports at the given 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. - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last execution of each export. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ExportsList(string scope, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-10-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.CostManagement/exports" + + scope + + "/providers/Microsoft.CostManagement/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -2104,23 +1956,27 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportsList_Call(request,onOk,onDefault,eventListener,sender); + await this.DimensionsList_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// The operation to list all exports at the given scope. + /// Lists the dimensions by the defined scope. /// - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last execution of each export. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExportsListViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsListViaIdentityWithResult(global::System.String viaIdentity, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -2128,10 +1984,10 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/dimensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/dimensions'"); } // replace URI parameters with values from identity @@ -2140,218 +1996,161 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.CostManagement/exports" + + "/providers/Microsoft.CostManagement/dimensions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.DimensionsListWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Lists the dimensions by the defined scope. + /// The scope associated with dimension 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.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. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExportsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DimensionsListWithResult(string scope, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// 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. - /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and - /// will return information for the last execution of each export. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ExportsList_Validate(string scope, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Expand),Expand); - } - } - - /// Lists the forecast charges for external cloud provider type defined. - /// 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'. - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage(string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-10-01"; - // Constant Parameters + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + global::System.Uri.EscapeDataString(externalCloudProviderType) - + "/" - + global::System.Uri.EscapeDataString(externalCloudProviderId) - + "/forecast" + "/" + + (scope) + + "/providers/Microsoft.CostManagement/dimensions" + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + (string.IsNullOrEmpty(Skiptoken) ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ForecastExternalCloudProviderUsage_Call(request,onOk,onDefault,eventListener,sender); + return await this.DimensionsListWithResult_Call (request, eventListener,sender); } } - /// Lists the forecast charges for external cloud provider type defined. - /// - /// 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'. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DimensionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2021-10-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; - var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + externalCloudProviderType - + "/" - + externalCloudProviderId - + "/forecast" - + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ForecastExternalCloudProviderUsage_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2359,7 +2158,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DimensionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2370,6 +2169,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2377,13 +2177,19 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2399,37 +2205,48 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// 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'. - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// The scope associated with dimension 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.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. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + /// Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included + /// when listing dimensions. + /// 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. + /// May be used to limit the number of results to the most recent N dimension data. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage_Validate(string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DimensionsList_Validate(string scope, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(scope),scope); await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); - await eventListener.AssertEnum(nameof(externalCloudProviderType),externalCloudProviderType,@"externalSubscriptions", @"externalBillingAccounts"); - await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(Skiptoken),Skiptoken); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertIsLessThanOrEqual(nameof(Top),Top,1000); } } - /// Lists the forecast charges for scope defined. - /// 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'. - /// The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for + /// + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// 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}' @@ -2438,17 +2255,19 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// Export Name. + /// Parameters supplied to the CreateOrUpdate Export operation. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ForecastUsage(string Filter, string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -2458,10 +2277,9 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.CostManagement/forecast" + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2469,34 +2287,36 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ForecastUsage_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ExportsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Lists the forecast charges for scope defined. + /// + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// /// - /// 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'. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// Parameters supplied to the CreateOrUpdate Export operation. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ForecastUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -2504,22 +2324,22 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/forecast'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.CostManagement/forecast" + + "/providers/Microsoft.CostManagement/exports/" + + exportName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2527,82 +2347,81 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ForecastUsage_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ExportsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// + /// Parameters supplied to the CreateOrUpdate Export operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ForecastUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// - /// 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'. - /// The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for + /// 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}' @@ -2611,52 +2430,74 @@ public partial class CostManagement /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// Export Name. + /// Json string supplied to the ExportsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ForecastUsage_Validate(string Filter, string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateViaJsonString(string scope, string exportName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } /// - /// 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. + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// - /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' - /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' - /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. - /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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}' + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Parameters supplied to the Create cost details operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Export Name. + /// Json string supplied to the ExportsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateViaJsonStringWithResult(string scope, string exportName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2022-05-01"; + var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2664,103 +2505,93 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GenerateCostDetailsReportCreateOperation_Call(request,onOk,onDefault,eventListener,sender); + return await this.ExportsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// 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. + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// - /// - /// Parameters supplied to the Create cost details operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// 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. + /// Export Name. + /// Parameters supplied to the CreateOrUpdate Export operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsCreateOrUpdateWithResult(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2022-05-01"; + var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GenerateCostDetailsReportCreateOperation_Call(request,onOk,onDefault,eventListener,sender); + return await this.ExportsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A + /// that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExportsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2768,106 +2599,79 @@ public partial class CostManagement try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2875,13 +2679,19 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2897,45 +2707,46 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' - /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' - /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. - /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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}' + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// Parameters supplied to the Create cost details operation. + /// Export Name. + /// Parameters supplied to the CreateOrUpdate Export operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ExportsCreateOrUpdate_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(exportName),exportName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location - /// header. - /// - /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' - /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' - /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. - /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// The operation to delete a export. + /// 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}' + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// The target operation Id. + /// Export Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2944,9 +2755,9 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults(string scope, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsDelete(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2022-05-01"; + var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2954,8 +2765,8 @@ public partial class CostManagement var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" - + global::System.Uri.EscapeDataString(operationId) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2964,19 +2775,16 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateCostDetailsReportGetOperationResults_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location - /// header. - /// + /// The operation to delete a export. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2986,29 +2794,29 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResultsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { - var apiVersion = @"2022-05-01"; + var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/costDetailsOperationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var operationId = _match.Groups["operationId"].Value; + var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" - + operationId + + "/providers/Microsoft.CostManagement/exports/" + + exportName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3017,18 +2825,16 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateCostDetailsReportGetOperationResults_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3038,7 +2844,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExportsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3049,103 +2855,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3153,13 +2863,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3175,38 +2885,43 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' - /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' - /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. - /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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}' + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. - /// The target operation Id. + /// Export Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults_Validate(string scope, string operationId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ExportsDelete_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertNotNull(nameof(exportName),exportName); } } - /// - /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role - /// - /// Enrollment ID (Legacy BillingAccount ID) - /// Start Date - /// End Date + /// The operation to execute an export. + /// 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. + /// Export Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3215,7 +2930,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId(string billingAccountId, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsExecute(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3223,14 +2938,12 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Billing/billingAccounts/" - + global::System.Uri.EscapeDataString(billingAccountId) - + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "/run" + "?" - + "startDate=" + global::System.Uri.EscapeDataString(startDate) - + "&" - + "endDate=" + global::System.Uri.EscapeDataString(endDate) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3243,17 +2956,12 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateReservationDetailsReportByBillingAccountId_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsExecute_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role - /// + /// The operation to execute an export. /// - /// Start Date - /// End Date /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3262,7 +2970,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountIdViaIdentity(global::System.String viaIdentity, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsExecuteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3270,24 +2978,23 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); } // replace URI parameters with values from identity - var billingAccountId = _match.Groups["billingAccountId"].Value; + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Billing/billingAccounts/" - + billingAccountId - + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "/run" + "?" - + "startDate=" + global::System.Uri.EscapeDataString(startDate) - + "&" - + "endDate=" + global::System.Uri.EscapeDataString(endDate) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3300,13 +3007,11 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateReservationDetailsReportByBillingAccountId_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsExecute_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3316,7 +3021,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExportsExecute_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3327,117 +3032,21 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3453,34 +3062,97 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// Enrollment ID (Legacy BillingAccount ID) - /// Start Date - /// End Date + /// 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. + /// Export Name. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId_Validate(string billingAccountId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ExportsExecute_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); - await eventListener.AssertNotNull(nameof(startDate),startDate); - await eventListener.AssertNotNull(nameof(endDate),endDate); + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(exportName),exportName); + } + } + + /// The operation to get the export for the defined scope by export name. + /// 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. + /// Export Name. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last 10 executions of the export. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsGet(string scope, string exportName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsGet_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// The operation to get the execution history of an export for the defined scope and export name. /// - /// BillingAccount ID - /// BillingProfile ID - /// Start Date - /// End Date + /// 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. + /// Export Name. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3489,7 +3161,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId(string billingAccountId, string billingProfileId, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsGetExecutionHistory(string scope, string exportName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3497,16 +3169,12 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Billing/billingAccounts/" - + global::System.Uri.EscapeDataString(billingAccountId) - + "/billingProfiles/" - + global::System.Uri.EscapeDataString(billingProfileId) - + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "/runHistory" + "?" - + "startDate=" + global::System.Uri.EscapeDataString(startDate) - + "&" - + "endDate=" + global::System.Uri.EscapeDataString(endDate) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3514,22 +3182,19 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateReservationDetailsReportByBillingProfileId_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsGetExecutionHistory_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// The operation to get the execution history of an export for the defined scope and export name. /// /// - /// Start Date - /// End Date /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3538,7 +3203,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileIdViaIdentity(global::System.String viaIdentity, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsGetExecutionHistoryViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3546,27 +3211,23 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/billingProfiles/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'"); } // replace URI parameters with values from identity - var billingAccountId = _match.Groups["billingAccountId"].Value; - var billingProfileId = _match.Groups["billingProfileId"].Value; + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Billing/billingAccounts/" - + billingAccountId - + "/billingProfiles/" - + billingProfileId - + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "/runHistory" + "?" - + "startDate=" + global::System.Uri.EscapeDataString(startDate) - + "&" - + "endDate=" + global::System.Uri.EscapeDataString(endDate) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3574,135 +3235,4841 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GenerateReservationDetailsReportByBillingProfileId_Call(request,onOk,onDefault,eventListener,sender); + await this.ExportsGetExecutionHistory_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// The operation to get the execution history of an export for the defined scope and export name. /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExportsGetExecutionHistoryViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + // verify that Identity format is an exact match for uri - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "/runHistory" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); - } - } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsGetExecutionHistoryWithResult_Call (request, eventListener,sender); + } + } + + /// + /// The operation to get the execution history of an export for the defined scope and export name. + /// + /// 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. + /// Export Name. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsGetExecutionHistoryWithResult(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "/runHistory" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsGetExecutionHistoryWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGetExecutionHistoryWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGetExecutionHistory_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// 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. + /// Export Name. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGetExecutionHistory_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(exportName),exportName); + } + } + + /// The operation to get the export for the defined scope by export name. + /// + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last 10 executions of the export. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to get the export for the defined scope by export name. + /// + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last 10 executions of the export. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsGetViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var exportName = _match.Groups["exportName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports/" + + exportName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsGetWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to get the export for the defined scope by export name. + /// 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. + /// Export Name. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last 10 executions of the export. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsGetWithResult(string scope, string exportName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports/" + + global::System.Uri.EscapeDataString(exportName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// 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. + /// Export Name. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last 10 executions of the export. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsGet_Validate(string scope, string exportName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(exportName),exportName); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// The operation to list all exports at the given 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. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last execution of each export. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsList(string scope, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to list all exports at the given scope. + /// + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last execution of each export. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsListViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to list all exports at the given scope. + /// + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last execution of each export. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsListViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/exports$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/exports'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/exports" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsListWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to list all exports at the given 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. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last execution of each export. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportsListWithResult(string scope, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/exports" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// 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. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and + /// will return information for the last execution of each export. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportsList_Validate(string scope, string Expand, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage(string externalCloudProviderType, string externalCloudProviderId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastExternalCloudProviderUsage_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}'"); + } + + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastExternalCloudProviderUsage_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}'"); + } + + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastExternalCloudProviderUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// 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'. + /// Json string supplied to the ForecastExternalCloudProviderUsage operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageViaJsonString(string externalCloudProviderType, string externalCloudProviderId, string Filter, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastExternalCloudProviderUsage_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// 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'. + /// Json string supplied to the ForecastExternalCloudProviderUsage operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageViaJsonStringWithResult(string externalCloudProviderType, string externalCloudProviderId, string Filter, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastExternalCloudProviderUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the forecast charges for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageWithResult(string externalCloudProviderType, string externalCloudProviderId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/forecast" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastExternalCloudProviderUsageWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsageWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastExternalCloudProviderUsage_Validate(string externalCloudProviderType, string externalCloudProviderId, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); + await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists the forecast charges for scope defined. + /// 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. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsage(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for scope defined. + /// + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for scope defined. + /// + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsageViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the forecast charges for scope defined. + /// 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. + /// 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'. + /// Json string supplied to the ForecastUsage operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsageViaJsonString(string scope, string Filter, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Lists the forecast charges for scope defined. + /// 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. + /// 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'. + /// Json string supplied to the ForecastUsage operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsageViaJsonStringWithResult(string scope, string Filter, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the forecast charges for scope defined. + /// 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. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ForecastUsageWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/forecast" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ForecastUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastUsageWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// 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. + /// 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'. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ForecastUsage_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// 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. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// Parameters supplied to the Create cost details operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportCreateOperation_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Parameters supplied to the Create cost details operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportCreateOperation_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// + /// Parameters supplied to the Create cost details operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateCostDetailsReportCreateOperationWithResult_Call (request, eventListener,sender); + } + } + + /// + /// 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. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// Json string supplied to the GenerateCostDetailsReportCreateOperation operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationViaJsonString(string scope, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportCreateOperation_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// Json string supplied to the GenerateCostDetailsReportCreateOperation operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationViaJsonStringWithResult(string scope, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateCostDetailsReportCreateOperationWithResult_Call (request, eventListener,sender); + } + } + + /// + /// 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. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// Parameters supplied to the Create cost details operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/generateCostDetailsReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateCostDetailsReportCreateOperationWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// Parameters supplied to the Create cost details operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportCreateOperation_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// The target operation Id. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults(string scope, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportGetOperationResults_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResultsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/costDetailsOperationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportGetOperationResults_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResultsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/costDetailsOperationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateCostDetailsReportGetOperationResultsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// The target operation Id. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResultsWithResult(string scope, string operationId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/costDetailsOperationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateCostDetailsReportGetOperationResultsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResultsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' + /// for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// The target operation Id. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateCostDetailsReportGetOperationResults_Validate(string scope, string operationId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role + /// + /// Enrollment ID (Legacy BillingAccount ID) + /// Start Date + /// End Date + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId(string billingAccountId, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + global::System.Uri.EscapeDataString(billingAccountId) + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingAccountId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role + /// + /// + /// Start Date + /// End Date + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountIdViaIdentity(global::System.String viaIdentity, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingAccountId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role + /// + /// + /// Start Date + /// End Date + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountIdViaIdentityWithResult(global::System.String viaIdentity, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateReservationDetailsReportByBillingAccountIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role + /// + /// Enrollment ID (Legacy BillingAccount ID) + /// Start Date + /// End Date + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountIdWithResult(string billingAccountId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + global::System.Uri.EscapeDataString(billingAccountId) + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateReservationDetailsReportByBillingAccountIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountIdWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// Enrollment ID (Legacy BillingAccount ID) + /// Start Date + /// End Date + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingAccountId_Validate(string billingAccountId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(startDate),startDate); + await eventListener.AssertNotNull(nameof(endDate),endDate); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// + /// BillingAccount ID + /// BillingProfile ID + /// Start Date + /// End Date + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId(string billingAccountId, string billingProfileId, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + global::System.Uri.EscapeDataString(billingAccountId) + + "/billingProfiles/" + + global::System.Uri.EscapeDataString(billingProfileId) + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingProfileId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// + /// + /// Start Date + /// End Date + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileIdViaIdentity(global::System.String viaIdentity, string startDate, string endDate, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/billingProfiles/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + var billingProfileId = _match.Groups["billingProfileId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/billingProfiles/" + + billingProfileId + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingProfileId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// + /// + /// Start Date + /// End Date + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileIdViaIdentityWithResult(global::System.String viaIdentity, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Billing/billingAccounts/(?[^/]+)/billingProfiles/(?[^/]+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var billingAccountId = _match.Groups["billingAccountId"].Value; + var billingProfileId = _match.Groups["billingProfileId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + billingAccountId + + "/billingProfiles/" + + billingProfileId + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateReservationDetailsReportByBillingProfileIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// 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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access + /// + /// BillingAccount ID + /// BillingProfile ID + /// Start Date + /// End Date + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileIdWithResult(string billingAccountId, string billingProfileId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Billing/billingAccounts/" + + global::System.Uri.EscapeDataString(billingAccountId) + + "/billingProfiles/" + + global::System.Uri.EscapeDataString(billingProfileId) + + "/providers/Microsoft.CostManagement/generateReservationDetailsReport" + + "?" + + "startDate=" + global::System.Uri.EscapeDataString(startDate) + + "&" + + "endDate=" + global::System.Uri.EscapeDataString(endDate) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GenerateReservationDetailsReportByBillingProfileIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileIdWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get); // drop the old response _response?.Dispose(); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// BillingAccount ID + /// BillingProfile ID + /// Start Date + /// End Date + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId_Validate(string billingAccountId, string billingProfileId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); + await eventListener.AssertNotNull(nameof(billingProfileId),billingProfileId); + await eventListener.AssertNotNull(nameof(startDate),startDate); + await eventListener.AssertNotNull(nameof(endDate),endDate); + } + } + + /// Lists all of the available cost management REST API operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available cost management REST API operations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available cost management REST API operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all of the available cost management REST API operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Query the usage data for scope defined. + /// 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. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsage(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType(string externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsageByExternalCloudProviderType_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}'"); + } + + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsageByExternalCloudProviderType_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}'"); + } + + // replace URI parameters with values from identity + var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; + var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + externalCloudProviderType + + "/" + + externalCloudProviderId + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QueryUsageByExternalCloudProviderTypeWithResult_Call (request, eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// Json string supplied to the QueryUsageByExternalCloudProviderType operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeViaJsonString(string externalCloudProviderType, string externalCloudProviderId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsageByExternalCloudProviderType_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// Json string supplied to the QueryUsageByExternalCloudProviderType operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeViaJsonStringWithResult(string externalCloudProviderType, string externalCloudProviderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QueryUsageByExternalCloudProviderTypeWithResult_Call (request, eventListener,sender); + } + } + + /// Query the usage data for external cloud provider type defined. + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeWithResult(string externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/" + + global::System.Uri.EscapeDataString(externalCloudProviderType) + + "/" + + global::System.Uri.EscapeDataString(externalCloudProviderId) + + "/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QueryUsageByExternalCloudProviderTypeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3710,13 +8077,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3732,46 +8099,63 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// BillingAccount ID - /// BillingProfile ID - /// Start Date - /// End Date + /// The external cloud provider type associated with dimension/query operations. This + /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' + /// for consolidated account used with dimension/query operations. + /// Parameters supplied to the CreateOrUpdate Query Config operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GenerateReservationDetailsReportByBillingProfileId_Validate(string billingAccountId, string billingProfileId, string startDate, string endDate, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType_Validate(string externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(billingAccountId),billingAccountId); - await eventListener.AssertNotNull(nameof(billingProfileId),billingProfileId); - await eventListener.AssertNotNull(nameof(startDate),startDate); - await eventListener.AssertNotNull(nameof(endDate),endDate); + await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); + await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists all of the available cost management REST API operations. + /// Query the usage data for scope defined. + /// + /// Parameters supplied to the CreateOrUpdate Query Config operation. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QueryUsageViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/operations" + "/" + + scope + + "/providers/Microsoft.CostManagement/query" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3780,26 +8164,30 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.QueryUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Lists all of the available cost management REST API operations. + /// Query the usage data for scope defined. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Parameters supplied to the CreateOrUpdate Query Config operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QueryUsageViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3807,36 +8195,53 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/operations'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement'"); } // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/operations" + "/" + + scope + + "/providers/Microsoft.CostManagement/query" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.QueryUsageWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Query the usage data for scope defined. + /// 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. + /// Json string supplied to the QueryUsage operation /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3844,7 +8249,146 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task QueryUsageViaJsonString(string scope, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsage_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Query the usage data for scope defined. + /// 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. + /// Json string supplied to the QueryUsage operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageViaJsonStringWithResult(string scope, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QueryUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Query the usage data for scope defined. + /// 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. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueryUsageWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.CostManagement/query" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.QueryUsageWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueryUsageWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3852,24 +8396,42 @@ public partial class CostManagement try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + throw new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException(_response); } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -3883,23 +8445,67 @@ public partial class CostManagement } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task QueryUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Query the usage data for scope defined. + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// /// 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}' @@ -3910,16 +8516,37 @@ public partial class CostManagement /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' /// specific for partners. /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueryUsage_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// The operation to 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. update operation does not require eTag. + /// + /// View name + /// Parameters supplied to the CreateOrUpdate View operation. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task QueryUsage(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3927,9 +8554,8 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (scope) - + "/providers/Microsoft.CostManagement/query" + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3938,34 +8564,46 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.QueryUsage_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ViewsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Query the usage data for external cloud provider type defined. - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. - /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// + /// The operation to 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. update operation does not require eTag. + /// + /// 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. + /// View name + /// Parameters supplied to the CreateOrUpdate View operation. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -3973,11 +8611,10 @@ public partial class CostManagement { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + global::System.Uri.EscapeDataString(externalCloudProviderType) - + "/" - + global::System.Uri.EscapeDataString(externalCloudProviderId) - + "/query" + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3986,31 +8623,36 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.QueryUsageByExternalCloudProviderType_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsCreateOrUpdateByScope_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Query the usage data for external cloud provider type defined. + /// + /// The operation to 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. update operation does not require eTag. + /// /// - /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// Parameters supplied to the CreateOrUpdate View operation. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderTypeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -4018,22 +8660,21 @@ public partial class CostManagement { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/(?[^/]+)/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'"); } // replace URI parameters with values from identity - var externalCloudProviderType = _match.Groups["externalCloudProviderType"].Value; - var externalCloudProviderId = _match.Groups["externalCloudProviderId"].Value; + var scope = _match.Groups["scope"].Value; + var viewName = _match.Groups["viewName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.CostManagement/" - + externalCloudProviderType - + "/" - + externalCloudProviderId - + "/query" + "/" + + scope + + "/providers/Microsoft.CostManagement/views/" + + viewName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4042,24 +8683,94 @@ public partial class CostManagement // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.QueryUsageByExternalCloudProviderType_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsCreateOrUpdateByScope_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// The operation to 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. update operation does not require eTag. /// - /// the prepared HttpRequestMessage to send. + /// + /// Parameters supplied to the CreateOrUpdate View operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var viewName = _match.Groups["viewName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/views/" + + viewName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsCreateOrUpdateByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// The operation to 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. update operation does not require eTag. + /// + /// 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. + /// View name + /// Json string supplied to the ViewsCreateOrUpdateByScope operation /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4067,128 +8778,222 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeViaJsonString(string scope, string viewName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsCreateOrUpdateByScope_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// The operation to 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. update operation does not require eTag. /// - /// The external cloud provider type associated with dimension/query operations. This - /// includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' - /// for consolidated account used with dimension/query operations. - /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// 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. + /// View name + /// Json string supplied to the ViewsCreateOrUpdateByScope operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that + /// will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QueryUsageByExternalCloudProviderType_Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeViaJsonStringWithResult(string scope, string viewName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(externalCloudProviderType),externalCloudProviderType); - await eventListener.AssertEnum(nameof(externalCloudProviderType),externalCloudProviderType,@"externalSubscriptions", @"externalBillingAccounts"); - await eventListener.AssertNotNull(nameof(externalCloudProviderId),externalCloudProviderId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsCreateOrUpdateByScopeWithResult_Call (request, eventListener,sender); } } - /// Query the usage data for scope defined. - /// - /// Parameters supplied to the CreateOrUpdate Query Config operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// The operation to 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. update operation does not require eTag. + /// + /// 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. + /// View name + /// Parameters supplied to the CreateOrUpdate View operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that + /// will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task QueryUsageViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeWithResult(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/query'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.CostManagement/query" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.QueryUsage_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ViewsCreateOrUpdateByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4196,7 +9001,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QueryUsage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4207,6 +9012,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4214,19 +9020,19 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4242,38 +9048,41 @@ public partial class CostManagement } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// 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. - /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// 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. + /// View name + /// Parameters supplied to the CreateOrUpdate View operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task QueryUsage_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope_Validate(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(viewName),viewName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// 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. + /// The operation to 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. update operation does not require eTag. /// - /// View name + /// /// Parameters supplied to the CreateOrUpdate View operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). @@ -4281,19 +9090,30 @@ public partial class CostManagement /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsCreateOrUpdate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/views/{viewName}'"); + } + + // replace URI parameters with values from identity + var viewName = _match.Groups["viewName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.CostManagement/views/" - + global::System.Uri.EscapeDataString(viewName) + + viewName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4307,78 +9127,74 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ViewsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } /// - /// 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. + /// The operation to 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. update operation does not require eTag. /// - /// 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. - /// View name + /// /// Parameters supplied to the CreateOrUpdate View operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that + /// will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/views/{viewName}'"); + } + + // replace URI parameters with values from identity + var viewName = _match.Groups["viewName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + global::System.Uri.EscapeDataString(scope) - + "/providers/Microsoft.CostManagement/views/" - + global::System.Uri.EscapeDataString(viewName) + "/providers/Microsoft.CostManagement/views/" + + viewName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ViewsCreateOrUpdateByScope_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.ViewsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// 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. + /// The operation to 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. update operation does not require eTag. /// - /// - /// Parameters supplied to the CreateOrUpdate View operation. + /// View name + /// Json string supplied to the ViewsCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4388,29 +9204,16 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScopeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateViaJsonString(string viewName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var viewName = _match.Groups["viewName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.CostManagement/views/" - + viewName + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4424,158 +9227,168 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsCreateOrUpdateByScope_Call(request,onOk,onCreated,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.ViewsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// The operation to 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. update operation does not require eTag. /// - /// 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. /// View name - /// Parameters supplied to the CreateOrUpdate View operation. + /// Json string supplied to the ViewsCreateOrUpdate operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that + /// will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateByScope_Validate(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateViaJsonStringWithResult(string viewName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { + var apiVersion = @"2021-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(viewName),viewName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// 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. + /// The operation to 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. update operation does not require eTag. /// - /// + /// View name /// Parameters supplied to the CreateOrUpdate View operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that + /// will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsCreateOrUpdateWithResult(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/views/{viewName}'"); - } - - // replace URI parameters with values from identity - var viewName = _match.Groups["viewName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.CostManagement/views/" - + viewName + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ViewsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.ViewsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). @@ -4586,7 +9399,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4597,6 +9410,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4604,19 +9418,19 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4641,7 +9455,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdate_Validate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ViewsCreateOrUpdate_Validate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView body, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4662,7 +9476,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsDelete(string viewName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsDelete(string viewName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -4685,7 +9499,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ViewsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -4710,7 +9524,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsDeleteByScope(string scope, string viewName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsDeleteByScope(string scope, string viewName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -4735,7 +9549,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsDeleteByScope_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ViewsDeleteByScope_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -4750,7 +9564,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsDeleteByScopeViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsDeleteByScopeViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -4786,11 +9600,11 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsDeleteByScope_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ViewsDeleteByScope_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -4801,7 +9615,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsDeleteByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsDeleteByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4812,6 +9626,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4831,7 +9646,7 @@ public partial class CostManagement default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4885,7 +9700,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -4918,11 +9733,11 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ViewsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -4933,7 +9748,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4944,6 +9759,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4963,7 +9779,7 @@ public partial class CostManagement default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5005,7 +9821,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsGet(string viewName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsGet(string viewName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5028,7 +9844,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5052,7 +9868,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsGetByScope(string scope, string viewName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsGetByScope(string scope, string viewName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5077,7 +9893,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsGetByScope_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsGetByScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5091,7 +9907,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsGetByScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsGetByScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5127,11 +9943,166 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsGetByScope_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsGetByScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the view for the defined scope by view name. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsGetByScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var viewName = _match.Groups["viewName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/views/" + + viewName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsGetByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the view for the defined scope by view name. + /// 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. + /// View name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsGetByScopeWithResult(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsGetByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsGetByScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5141,7 +10112,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsGetByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsGetByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5152,6 +10123,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5159,13 +10131,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5218,7 +10190,52 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/views/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/views/{viewName}'"); + } + + // replace URI parameters with values from identity + var viewName = _match.Groups["viewName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/views/" + + viewName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the view by view name. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5237,25 +10254,120 @@ public partial class CostManagement // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.CostManagement/views/" - + viewName + + viewName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the view by view name. + /// View name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsGetWithResult(string viewName, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/views/" + + global::System.Uri.EscapeDataString(viewName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ViewsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ViewsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5265,7 +10377,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5276,6 +10388,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5283,13 +10396,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5330,7 +10443,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5352,7 +10465,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsList_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5375,7 +10488,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsListByScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsListByScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5399,7 +10512,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsListByScope_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsListByScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5413,7 +10526,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsListByScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsListByScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5447,11 +10560,162 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsListByScope_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsListByScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all views at the given scope. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsListByScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("(?.+)/providers/Microsoft.CostManagement/views$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/views'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/views" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsListByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all views at the given 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. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsListByScopeWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + global::System.Uri.EscapeDataString(scope) + + "/providers/Microsoft.CostManagement/views" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsListByScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsListByScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5461,7 +10725,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsListByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsListByScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5472,6 +10736,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5479,13 +10744,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5536,7 +10801,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ViewsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ViewsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { var apiVersion = @"2021-10-01"; // Constant Parameters @@ -5567,11 +10832,147 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ViewsList_Call(request,onOk,onDefault,eventListener,sender); + await this.ViewsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all views by tenant and object. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.CostManagement/views$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.CostManagement/views'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/views" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all views by tenant and object. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ViewsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.CostManagement/views" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ViewsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5581,7 +10982,7 @@ public partial class CostManagement /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ViewsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ViewsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5592,6 +10993,7 @@ public partial class CostManagement await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5599,13 +11001,13 @@ public partial class CostManagement case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.PowerShell.cs new file mode 100644 index 000000000000..85abc20c75fb --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.PowerShell.cs @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// An individual alert. + [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] + public partial class Alert + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Alert(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Alert(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Alert(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Alert(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An individual alert. + [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] + public partial interface IAlert + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.TypeConverter.cs similarity index 98% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.TypeConverter.cs index 3ac3749ccdf0..12bd7a713b46 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.cs similarity index 58% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.cs index 5c0e3ad62fd8..e1d2cd76edbc 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.cs @@ -3,201 +3,205 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// An individual alert. public partial class Alert : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(); /// dateTime in which alert was closed [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } + public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } /// related budget [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } + public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } /// dateTime in which alert was created [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } + public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } /// Alert category [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory)""); } + public string DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? null; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria)""); } + public string DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? null; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionType = value ?? null; } /// Alert description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Description = value ?? null; } /// budget threshold amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } /// company name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } /// list of emails to contact [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } /// department name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } /// datetime of enrollmentEndDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } /// enrollment number [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } /// datetime of enrollmentStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } /// invoicing threshold [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } /// array of meters to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator)""); } + public string DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOperator = value ?? null; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } /// datetime of periodStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } /// array of resources to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } /// notification threshold percentage as a decimal which activated this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } /// Type of timegrain cadence [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType)""); } + public string DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? null; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } /// unit of currency being used [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit = value ?? null; } + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailUnit = value ?? null; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; } /// Internal Acessors for Definition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Definition = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Definition = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Detail = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Detail = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type = value; } /// dateTime in which alert was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } + public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties _property; /// Alert properties. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Source of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Source = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource)""); } + public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Source = value ?? null; } /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Status = value ?? null; } /// dateTime in which the alert status was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } + public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } /// User who last modified the alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } + public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; } /// Creates an new instance. public Alert() @@ -220,12 +224,15 @@ public Alert() /// An individual alert. public partial interface IAlert : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource { /// dateTime in which alert was closed [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was closed", SerializedName = @"closeTime", PossibleTypes = new [] { typeof(string) })] @@ -234,6 +241,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"related budget", SerializedName = @"costEntityId", PossibleTypes = new [] { typeof(string) })] @@ -242,6 +252,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was created", SerializedName = @"creationTime", PossibleTypes = new [] { typeof(string) })] @@ -250,30 +263,45 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert category", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Criteria that triggered alert", SerializedName = @"criteria", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"type of alert", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert description", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +310,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"budget threshold amount", SerializedName = @"amount", PossibleTypes = new [] { typeof(decimal) })] @@ -290,6 +321,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"company name", SerializedName = @"companyName", PossibleTypes = new [] { typeof(string) })] @@ -298,30 +332,42 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of emails to contact", SerializedName = @"contactEmails", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of action groups to broadcast to", SerializedName = @"contactGroups", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of contact roles", SerializedName = @"contactRoles", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"current spend", SerializedName = @"currentSpend", PossibleTypes = new [] { typeof(decimal) })] @@ -330,6 +376,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"department name", SerializedName = @"departmentName", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +387,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentEndDate", SerializedName = @"enrollmentEndDate", PossibleTypes = new [] { typeof(string) })] @@ -346,6 +398,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"enrollment number", SerializedName = @"enrollmentNumber", PossibleTypes = new [] { typeof(string) })] @@ -354,6 +409,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentStartDate", SerializedName = @"enrollmentStartDate", PossibleTypes = new [] { typeof(string) })] @@ -362,6 +420,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"invoicing threshold", SerializedName = @"invoicingThreshold", PossibleTypes = new [] { typeof(decimal) })] @@ -370,22 +431,32 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of meters to filter by", SerializedName = @"meterFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"operator used to compare currentSpend with amount", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"overriding alert", SerializedName = @"overridingAlert", PossibleTypes = new [] { typeof(string) })] @@ -394,6 +465,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of periodStartDate", SerializedName = @"periodStartDate", PossibleTypes = new [] { typeof(string) })] @@ -402,22 +476,31 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resources to filter by", SerializedName = @"resourceFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resourceGroups to filter by", SerializedName = @"resourceGroupFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"tags to filter by", SerializedName = @"tagFilter", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] @@ -426,6 +509,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notification threshold percentage as a decimal which activated this alert", SerializedName = @"threshold", PossibleTypes = new [] { typeof(decimal) })] @@ -434,14 +520,21 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of timegrain cadence", SerializedName = @"timeGrainType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notificationId that triggered this alert", SerializedName = @"triggeredBy", PossibleTypes = new [] { typeof(string) })] @@ -450,6 +543,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"unit of currency being used", SerializedName = @"unit", PossibleTypes = new [] { typeof(string) })] @@ -458,6 +554,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was last modified", SerializedName = @"modificationTime", PossibleTypes = new [] { typeof(string) })] @@ -466,22 +565,33 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source of alert", SerializedName = @"source", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"alert status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which the alert status was last modified", SerializedName = @"statusModificationTime", PossibleTypes = new [] { typeof(string) })] @@ -490,6 +600,9 @@ public partial interface IAlert : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User who last modified the alert", SerializedName = @"statusModificationUserName", PossibleTypes = new [] { typeof(string) })] @@ -498,7 +611,7 @@ public partial interface IAlert : } /// An individual alert. public partial interface IAlertInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal { /// dateTime in which alert was closed string CloseTime { get; set; } @@ -507,27 +620,30 @@ public partial interface IAlertInternal : /// dateTime in which alert was created string CreationTime { get; set; } /// defines the type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Definition { get; set; } /// Alert category - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description string Description { get; set; } /// Alert details - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Detail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Detail { get; set; } /// budget threshold amount decimal? DetailAmount { get; set; } /// company name string DetailCompanyName { get; set; } /// list of emails to contact - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend decimal? DetailCurrentSpend { get; set; } /// department name @@ -541,23 +657,25 @@ public partial interface IAlertInternal : /// invoicing threshold decimal? DetailInvoicingThreshold { get; set; } /// array of meters to filter by - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert string DetailOverridingAlert { get; set; } /// datetime of periodStartDate string DetailPeriodStartDate { get; set; } /// array of resources to filter by - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get; set; } /// notification threshold percentage as a decimal which activated this alert decimal? DetailThreshold { get; set; } /// Type of timegrain cadence - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert string DetailTriggeredBy { get; set; } /// unit of currency being used @@ -565,11 +683,13 @@ public partial interface IAlertInternal : /// dateTime in which alert was last modified string ModificationTime { get; set; } /// Alert properties. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Property { get; set; } /// Source of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified string StatusModificationTime { get; set; } /// User who last modified the alert diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.json.cs index f23b262df0e6..e4baf2cb945c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Alert.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,17 @@ internal Alert(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.Js { return; } - __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new Alert(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.PowerShell.cs new file mode 100644 index 000000000000..eb957b12cd41 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.PowerShell.cs @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// Alert properties. + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] + public partial class AlertProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Alert properties. + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] + public partial interface IAlertProperties + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.TypeConverter.cs index 19348aadc67b..daadcec1e1fc 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.cs similarity index 63% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.cs index ebc700284d21..3f9d971dd75a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Alert properties. public partial class AlertProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal { /// Backing field for property. @@ -35,23 +35,23 @@ public partial class AlertProperties : public string CreationTime { get => this._creationTime; set => this._creationTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition _definition; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition _definition; /// defines the type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinition()); set => this._definition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinition()); set => this._definition = value; } /// Alert category [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Category = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory)""); } + public string DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Category = value ?? null; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Criterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria)""); } + public string DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Criterion = value ?? null; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)Definition).Type = value ?? null; } /// Backing field for property. private string _description; @@ -61,105 +61,105 @@ public partial class AlertProperties : public string Description { get => this._description; set => this._description = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails _detail; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails _detail; /// Alert details [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetails()); set => this._detail = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetails()); set => this._detail = value; } /// budget threshold amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Amount = value ?? default(decimal); } + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Amount = value ?? default(decimal); } /// company name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CompanyName = value ?? null; } + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).CompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).CompanyName = value ?? null; } /// list of emails to contact [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactEmail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactEmail = value ?? null /* arrayOf */; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactGroup = value ?? null /* arrayOf */; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactRole = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ContactRole = value ?? null /* arrayOf */; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CurrentSpend = value ?? default(decimal); } + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).CurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).CurrentSpend = value ?? default(decimal); } /// department name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).DepartmentName = value ?? null; } + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).DepartmentName = value ?? null; } /// datetime of enrollmentEndDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate = value ?? null; } + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate = value ?? null; } /// enrollment number [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber = value ?? null; } + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber = value ?? null; } /// datetime of enrollmentStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate = value ?? null; } + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate = value ?? null; } /// invoicing threshold [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold = value ?? default(decimal); } + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold = value ?? default(decimal); } /// array of meters to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).MeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).MeterFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).MeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).MeterFilter = value ?? null /* arrayOf */; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Operator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator)""); } + public string DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Operator = value ?? null; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).OverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).OverridingAlert = value ?? null; } + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).OverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).OverridingAlert = value ?? null; } /// datetime of periodStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate = value ?? null; } + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate = value ?? null; } /// array of resources to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ResourceFilter = value ?? null /* arrayOf */; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter = value ?? null /* arrayOf */; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TagFilter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TagFilter = value ?? null /* model class */; } /// notification threshold percentage as a decimal which activated this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Threshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Threshold = value ?? default(decimal); } + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Threshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Threshold = value ?? default(decimal); } /// Type of timegrain cadence [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType)""); } + public string DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TimeGrainType = value ?? null; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TriggeredBy = value ?? null; } + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).TriggeredBy = value ?? null; } /// unit of currency being used [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Unit = value ?? null; } + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)Detail).Unit = value ?? null; } /// Internal Acessors for Definition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinition()); set { {_definition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinition()); set { {_definition = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal.Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetails()); set { {_detail = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal.Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetails()); set { {_detail = value;} } } /// Backing field for property. private string _modificationTime; @@ -169,18 +169,18 @@ public partial class AlertProperties : public string ModificationTime { get => this._modificationTime; set => this._modificationTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? _source; + private string _source; /// Source of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get => this._source; set => this._source = value; } + public string Source { get => this._source; set => this._source = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? _status; + private string _status; /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private string _statusModificationTime; @@ -210,6 +210,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was closed", SerializedName = @"closeTime", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +221,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"related budget", SerializedName = @"costEntityId", PossibleTypes = new [] { typeof(string) })] @@ -226,6 +232,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was created", SerializedName = @"creationTime", PossibleTypes = new [] { typeof(string) })] @@ -234,30 +243,45 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert category", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Criteria that triggered alert", SerializedName = @"criteria", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"type of alert", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert description", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -266,6 +290,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"budget threshold amount", SerializedName = @"amount", PossibleTypes = new [] { typeof(decimal) })] @@ -274,6 +301,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"company name", SerializedName = @"companyName", PossibleTypes = new [] { typeof(string) })] @@ -282,30 +312,42 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of emails to contact", SerializedName = @"contactEmails", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of action groups to broadcast to", SerializedName = @"contactGroups", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of contact roles", SerializedName = @"contactRoles", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"current spend", SerializedName = @"currentSpend", PossibleTypes = new [] { typeof(decimal) })] @@ -314,6 +356,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"department name", SerializedName = @"departmentName", PossibleTypes = new [] { typeof(string) })] @@ -322,6 +367,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentEndDate", SerializedName = @"enrollmentEndDate", PossibleTypes = new [] { typeof(string) })] @@ -330,6 +378,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"enrollment number", SerializedName = @"enrollmentNumber", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +389,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentStartDate", SerializedName = @"enrollmentStartDate", PossibleTypes = new [] { typeof(string) })] @@ -346,6 +400,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"invoicing threshold", SerializedName = @"invoicingThreshold", PossibleTypes = new [] { typeof(decimal) })] @@ -354,22 +411,32 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of meters to filter by", SerializedName = @"meterFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"operator used to compare currentSpend with amount", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"overriding alert", SerializedName = @"overridingAlert", PossibleTypes = new [] { typeof(string) })] @@ -378,6 +445,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of periodStartDate", SerializedName = @"periodStartDate", PossibleTypes = new [] { typeof(string) })] @@ -386,22 +456,31 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resources to filter by", SerializedName = @"resourceFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resourceGroups to filter by", SerializedName = @"resourceGroupFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"tags to filter by", SerializedName = @"tagFilter", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] @@ -410,6 +489,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notification threshold percentage as a decimal which activated this alert", SerializedName = @"threshold", PossibleTypes = new [] { typeof(decimal) })] @@ -418,14 +500,21 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of timegrain cadence", SerializedName = @"timeGrainType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notificationId that triggered this alert", SerializedName = @"triggeredBy", PossibleTypes = new [] { typeof(string) })] @@ -434,6 +523,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"unit of currency being used", SerializedName = @"unit", PossibleTypes = new [] { typeof(string) })] @@ -442,6 +534,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was last modified", SerializedName = @"modificationTime", PossibleTypes = new [] { typeof(string) })] @@ -450,22 +545,33 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source of alert", SerializedName = @"source", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"alert status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which the alert status was last modified", SerializedName = @"statusModificationTime", PossibleTypes = new [] { typeof(string) })] @@ -474,6 +580,9 @@ public partial interface IAlertProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User who last modified the alert", SerializedName = @"statusModificationUserName", PossibleTypes = new [] { typeof(string) })] @@ -491,27 +600,30 @@ public partial interface IAlertPropertiesInternal /// dateTime in which alert was created string CreationTime { get; set; } /// defines the type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Definition { get; set; } /// Alert category - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description string Description { get; set; } /// Alert details - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Detail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Detail { get; set; } /// budget threshold amount decimal? DetailAmount { get; set; } /// company name string DetailCompanyName { get; set; } /// list of emails to contact - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend decimal? DetailCurrentSpend { get; set; } /// department name @@ -525,23 +637,25 @@ public partial interface IAlertPropertiesInternal /// invoicing threshold decimal? DetailInvoicingThreshold { get; set; } /// array of meters to filter by - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert string DetailOverridingAlert { get; set; } /// datetime of periodStartDate string DetailPeriodStartDate { get; set; } /// array of resources to filter by - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get; set; } /// notification threshold percentage as a decimal which activated this alert decimal? DetailThreshold { get; set; } /// Type of timegrain cadence - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert string DetailTriggeredBy { get; set; } /// unit of currency being used @@ -549,9 +663,11 @@ public partial interface IAlertPropertiesInternal /// dateTime in which alert was last modified string ModificationTime { get; set; } /// Source of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified string StatusModificationTime { get; set; } /// User who last modified the alert diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.json.cs index 79977051cdb2..1ac4430956a2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,28 +65,28 @@ internal AlertProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinition.FromJson(__jsonDefinition) : Definition;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetails.FromJson(__jsonDetails) : Detail;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} - {_costEntityId = If( json?.PropertyT("costEntityId"), out var __jsonCostEntityId) ? (string)__jsonCostEntityId : (string)CostEntityId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? (string)__jsonCreationTime : (string)CreationTime;} - {_closeTime = If( json?.PropertyT("closeTime"), out var __jsonCloseTime) ? (string)__jsonCloseTime : (string)CloseTime;} - {_modificationTime = If( json?.PropertyT("modificationTime"), out var __jsonModificationTime) ? (string)__jsonModificationTime : (string)ModificationTime;} - {_statusModificationUserName = If( json?.PropertyT("statusModificationUserName"), out var __jsonStatusModificationUserName) ? (string)__jsonStatusModificationUserName : (string)StatusModificationUserName;} - {_statusModificationTime = If( json?.PropertyT("statusModificationTime"), out var __jsonStatusModificationTime) ? (string)__jsonStatusModificationTime : (string)StatusModificationTime;} + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinition.FromJson(__jsonDefinition) : _definition;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetails.FromJson(__jsonDetails) : _detail;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)_source;} + {_costEntityId = If( json?.PropertyT("costEntityId"), out var __jsonCostEntityId) ? (string)__jsonCostEntityId : (string)_costEntityId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? (string)__jsonCreationTime : (string)_creationTime;} + {_closeTime = If( json?.PropertyT("closeTime"), out var __jsonCloseTime) ? (string)__jsonCloseTime : (string)_closeTime;} + {_modificationTime = If( json?.PropertyT("modificationTime"), out var __jsonModificationTime) ? (string)__jsonModificationTime : (string)_modificationTime;} + {_statusModificationUserName = If( json?.PropertyT("statusModificationUserName"), out var __jsonStatusModificationUserName) ? (string)__jsonStatusModificationUserName : (string)_statusModificationUserName;} + {_statusModificationTime = If( json?.PropertyT("statusModificationTime"), out var __jsonStatusModificationTime) ? (string)__jsonStatusModificationTime : (string)_statusModificationTime;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new AlertProperties(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.PowerShell.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.PowerShell.cs index de4a423d7d05..1398a542c696 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AlertPropertiesDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,21 +78,21 @@ internal AlertPropertiesDefinition(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Criterion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Criterion = (string) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Criterion, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,43 +107,41 @@ internal AlertPropertiesDefinition(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Criterion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Criterion = (string) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal)this).Criterion, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertPropertiesDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertPropertiesDefinition(content); } @@ -145,12 +151,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// defines the type of alert [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDefinitionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.TypeConverter.cs index 8f49febdc586..c03a28306975 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.cs similarity index 52% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.cs index d73bafb1548d..8ac7d5128e92 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.cs @@ -3,36 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// defines the type of alert public partial class AlertPropertiesDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinitionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? _category; + private string _category; /// Alert category [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? Category { get => this._category; set => this._category = value; } + public string Category { get => this._category; set => this._category = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? _criterion; + private string _criterion; /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? Criterion { get => this._criterion; set => this._criterion = value; } + public string Criterion { get => this._criterion; set => this._criterion = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? _type; + private string _type; /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public AlertPropertiesDefinition() @@ -48,26 +48,38 @@ public partial interface IAlertPropertiesDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert category", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? Category { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string Category { get; set; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Criteria that triggered alert", SerializedName = @"criteria", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? Criterion { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string Criterion { get; set; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"type of alert", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string Type { get; set; } } /// defines the type of alert @@ -75,11 +87,14 @@ public partial interface IAlertPropertiesDefinitionInternal { /// Alert category - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? Category { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string Category { get; set; } /// Criteria that triggered alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? Criterion { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string Criterion { get; set; } /// type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.json.cs index 00208db626ab..13be29d74038 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AlertPropertiesDefinition(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_criterion = If( json?.PropertyT("criteria"), out var __jsonCriteria) ? (string)__jsonCriteria : (string)Criterion;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_criterion = If( json?.PropertyT("criteria"), out var __jsonCriteria) ? (string)__jsonCriteria : (string)_criterion;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new AlertPropertiesDefinition(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.PowerShell.cs new file mode 100644 index 000000000000..afe3e1db4d92 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.PowerShell.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// Alert details + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailsTypeConverter))] + public partial class AlertPropertiesDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertPropertiesDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TimeGrainType = (string) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("PeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("TriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).MeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactRole = (System.Collections.Generic.List) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("OverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("InvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).InvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertPropertiesDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TimeGrainType = (string) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("PeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("TriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).MeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactRole = (System.Collections.Generic.List) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("OverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("InvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal)this).InvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertPropertiesDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertPropertiesDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Alert details + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailsTypeConverter))] + public partial interface IAlertPropertiesDetails + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.TypeConverter.cs index e119cebd481c..60697114b7da 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.cs similarity index 79% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.cs index b3feff16d896..bcb0308cbd65 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Alert details public partial class AlertPropertiesDetails : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetailsInternal { /// Backing field for property. @@ -28,25 +28,25 @@ public partial class AlertPropertiesDetails : public string CompanyName { get => this._companyName; set => this._companyName = value; } /// Backing field for property. - private string[] _contactEmail; + private System.Collections.Generic.List _contactEmail; /// list of emails to contact [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] ContactEmail { get => this._contactEmail; set => this._contactEmail = value; } + public System.Collections.Generic.List ContactEmail { get => this._contactEmail; set => this._contactEmail = value; } /// Backing field for property. - private string[] _contactGroup; + private System.Collections.Generic.List _contactGroup; /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] ContactGroup { get => this._contactGroup; set => this._contactGroup = value; } + public System.Collections.Generic.List ContactGroup { get => this._contactGroup; set => this._contactGroup = value; } /// Backing field for property. - private string[] _contactRole; + private System.Collections.Generic.List _contactRole; /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] ContactRole { get => this._contactRole; set => this._contactRole = value; } + public System.Collections.Generic.List ContactRole { get => this._contactRole; set => this._contactRole = value; } /// Backing field for property. private decimal? _currentSpend; @@ -91,18 +91,18 @@ public partial class AlertPropertiesDetails : public decimal? InvoicingThreshold { get => this._invoicingThreshold; set => this._invoicingThreshold = value; } /// Backing field for property. - private string[] _meterFilter; + private System.Collections.Generic.List _meterFilter; /// array of meters to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] MeterFilter { get => this._meterFilter; set => this._meterFilter = value; } + public System.Collections.Generic.List MeterFilter { get => this._meterFilter; set => this._meterFilter = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? _operator; + private string _operator; /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. private string _overridingAlert; @@ -119,18 +119,18 @@ public partial class AlertPropertiesDetails : public string PeriodStartDate { get => this._periodStartDate; set => this._periodStartDate = value; } /// Backing field for property. - private string[] _resourceFilter; + private System.Collections.Generic.List _resourceFilter; /// array of resources to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] ResourceFilter { get => this._resourceFilter; set => this._resourceFilter = value; } + public System.Collections.Generic.List ResourceFilter { get => this._resourceFilter; set => this._resourceFilter = value; } /// Backing field for property. - private string[] _resourceGroupFilter; + private System.Collections.Generic.List _resourceGroupFilter; /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] ResourceGroupFilter { get => this._resourceGroupFilter; set => this._resourceGroupFilter = value; } + public System.Collections.Generic.List ResourceGroupFilter { get => this._resourceGroupFilter; set => this._resourceGroupFilter = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny _tagFilter; @@ -147,11 +147,11 @@ public partial class AlertPropertiesDetails : public decimal? Threshold { get => this._threshold; set => this._threshold = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? _timeGrainType; + private string _timeGrainType; /// Type of timegrain cadence [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? TimeGrainType { get => this._timeGrainType; set => this._timeGrainType = value; } + public string TimeGrainType { get => this._timeGrainType; set => this._timeGrainType = value; } /// Backing field for property. private string _triggeredBy; @@ -181,6 +181,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"budget threshold amount", SerializedName = @"amount", PossibleTypes = new [] { typeof(decimal) })] @@ -189,6 +192,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"company name", SerializedName = @"companyName", PossibleTypes = new [] { typeof(string) })] @@ -197,30 +203,42 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of emails to contact", SerializedName = @"contactEmails", PossibleTypes = new [] { typeof(string) })] - string[] ContactEmail { get; set; } + System.Collections.Generic.List ContactEmail { get; set; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of action groups to broadcast to", SerializedName = @"contactGroups", PossibleTypes = new [] { typeof(string) })] - string[] ContactGroup { get; set; } + System.Collections.Generic.List ContactGroup { get; set; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of contact roles", SerializedName = @"contactRoles", PossibleTypes = new [] { typeof(string) })] - string[] ContactRole { get; set; } + System.Collections.Generic.List ContactRole { get; set; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"current spend", SerializedName = @"currentSpend", PossibleTypes = new [] { typeof(decimal) })] @@ -229,6 +247,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"department name", SerializedName = @"departmentName", PossibleTypes = new [] { typeof(string) })] @@ -237,6 +258,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentEndDate", SerializedName = @"enrollmentEndDate", PossibleTypes = new [] { typeof(string) })] @@ -245,6 +269,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"enrollment number", SerializedName = @"enrollmentNumber", PossibleTypes = new [] { typeof(string) })] @@ -253,6 +280,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentStartDate", SerializedName = @"enrollmentStartDate", PossibleTypes = new [] { typeof(string) })] @@ -261,6 +291,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"invoicing threshold", SerializedName = @"invoicingThreshold", PossibleTypes = new [] { typeof(decimal) })] @@ -269,22 +302,32 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of meters to filter by", SerializedName = @"meterFilter", PossibleTypes = new [] { typeof(string) })] - string[] MeterFilter { get; set; } + System.Collections.Generic.List MeterFilter { get; set; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"operator used to compare currentSpend with amount", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string Operator { get; set; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"overriding alert", SerializedName = @"overridingAlert", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +336,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of periodStartDate", SerializedName = @"periodStartDate", PossibleTypes = new [] { typeof(string) })] @@ -301,22 +347,31 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resources to filter by", SerializedName = @"resourceFilter", PossibleTypes = new [] { typeof(string) })] - string[] ResourceFilter { get; set; } + System.Collections.Generic.List ResourceFilter { get; set; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resourceGroups to filter by", SerializedName = @"resourceGroupFilter", PossibleTypes = new [] { typeof(string) })] - string[] ResourceGroupFilter { get; set; } + System.Collections.Generic.List ResourceGroupFilter { get; set; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"tags to filter by", SerializedName = @"tagFilter", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] @@ -325,6 +380,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notification threshold percentage as a decimal which activated this alert", SerializedName = @"threshold", PossibleTypes = new [] { typeof(decimal) })] @@ -333,14 +391,21 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of timegrain cadence", SerializedName = @"timeGrainType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? TimeGrainType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string TimeGrainType { get; set; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notificationId that triggered this alert", SerializedName = @"triggeredBy", PossibleTypes = new [] { typeof(string) })] @@ -349,6 +414,9 @@ public partial interface IAlertPropertiesDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"unit of currency being used", SerializedName = @"unit", PossibleTypes = new [] { typeof(string) })] @@ -364,11 +432,11 @@ public partial interface IAlertPropertiesDetailsInternal /// company name string CompanyName { get; set; } /// list of emails to contact - string[] ContactEmail { get; set; } + System.Collections.Generic.List ContactEmail { get; set; } /// list of action groups to broadcast to - string[] ContactGroup { get; set; } + System.Collections.Generic.List ContactGroup { get; set; } /// list of contact roles - string[] ContactRole { get; set; } + System.Collections.Generic.List ContactRole { get; set; } /// current spend decimal? CurrentSpend { get; set; } /// department name @@ -382,23 +450,25 @@ public partial interface IAlertPropertiesDetailsInternal /// invoicing threshold decimal? InvoicingThreshold { get; set; } /// array of meters to filter by - string[] MeterFilter { get; set; } + System.Collections.Generic.List MeterFilter { get; set; } /// operator used to compare currentSpend with amount - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string Operator { get; set; } /// overriding alert string OverridingAlert { get; set; } /// datetime of periodStartDate string PeriodStartDate { get; set; } /// array of resources to filter by - string[] ResourceFilter { get; set; } + System.Collections.Generic.List ResourceFilter { get; set; } /// array of resourceGroups to filter by - string[] ResourceGroupFilter { get; set; } + System.Collections.Generic.List ResourceGroupFilter { get; set; } /// tags to filter by Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny TagFilter { get; set; } /// notification threshold percentage as a decimal which activated this alert decimal? Threshold { get; set; } /// Type of timegrain cadence - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? TimeGrainType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string TimeGrainType { get; set; } /// notificationId that triggered this alert string TriggeredBy { get; set; } /// unit of currency being used diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.json.cs similarity index 85% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.json.cs index f290bbc1fd96..6f6c4cc63fa6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertPropertiesDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,39 +65,39 @@ internal AlertPropertiesDetails(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_timeGrainType = If( json?.PropertyT("timeGrainType"), out var __jsonTimeGrainType) ? (string)__jsonTimeGrainType : (string)TimeGrainType;} - {_periodStartDate = If( json?.PropertyT("periodStartDate"), out var __jsonPeriodStartDate) ? (string)__jsonPeriodStartDate : (string)PeriodStartDate;} - {_triggeredBy = If( json?.PropertyT("triggeredBy"), out var __jsonTriggeredBy) ? (string)__jsonTriggeredBy : (string)TriggeredBy;} - {_resourceGroupFilter = If( json?.PropertyT("resourceGroupFilter"), out var __jsonResourceGroupFilter) ? If( __jsonResourceGroupFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ResourceGroupFilter;} - {_resourceFilter = If( json?.PropertyT("resourceFilter"), out var __jsonResourceFilter) ? If( __jsonResourceFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ResourceFilter;} - {_meterFilter = If( json?.PropertyT("meterFilter"), out var __jsonMeterFilter) ? If( __jsonMeterFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : MeterFilter;} - {_tagFilter = If( json?.PropertyT("tagFilter"), out var __jsonTagFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Any.FromJson(__jsonTagFilter) : TagFilter;} - {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (decimal?)__jsonThreshold : Threshold;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : Amount;} - {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} - {_currentSpend = If( json?.PropertyT("currentSpend"), out var __jsonCurrentSpend) ? (decimal?)__jsonCurrentSpend : CurrentSpend;} - {_contactEmail = If( json?.PropertyT("contactEmails"), out var __jsonContactEmails) ? If( __jsonContactEmails as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : ContactEmail;} - {_contactGroup = If( json?.PropertyT("contactGroups"), out var __jsonContactGroups) ? If( __jsonContactGroups as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : ContactGroup;} - {_contactRole = If( json?.PropertyT("contactRoles"), out var __jsonContactRoles) ? If( __jsonContactRoles as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : ContactRole;} - {_overridingAlert = If( json?.PropertyT("overridingAlert"), out var __jsonOverridingAlert) ? (string)__jsonOverridingAlert : (string)OverridingAlert;} - {_departmentName = If( json?.PropertyT("departmentName"), out var __jsonDepartmentName) ? (string)__jsonDepartmentName : (string)DepartmentName;} - {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)CompanyName;} - {_enrollmentNumber = If( json?.PropertyT("enrollmentNumber"), out var __jsonEnrollmentNumber) ? (string)__jsonEnrollmentNumber : (string)EnrollmentNumber;} - {_enrollmentStartDate = If( json?.PropertyT("enrollmentStartDate"), out var __jsonEnrollmentStartDate) ? (string)__jsonEnrollmentStartDate : (string)EnrollmentStartDate;} - {_enrollmentEndDate = If( json?.PropertyT("enrollmentEndDate"), out var __jsonEnrollmentEndDate) ? (string)__jsonEnrollmentEndDate : (string)EnrollmentEndDate;} - {_invoicingThreshold = If( json?.PropertyT("invoicingThreshold"), out var __jsonInvoicingThreshold) ? (decimal?)__jsonInvoicingThreshold : InvoicingThreshold;} + {_timeGrainType = If( json?.PropertyT("timeGrainType"), out var __jsonTimeGrainType) ? (string)__jsonTimeGrainType : (string)_timeGrainType;} + {_periodStartDate = If( json?.PropertyT("periodStartDate"), out var __jsonPeriodStartDate) ? (string)__jsonPeriodStartDate : (string)_periodStartDate;} + {_triggeredBy = If( json?.PropertyT("triggeredBy"), out var __jsonTriggeredBy) ? (string)__jsonTriggeredBy : (string)_triggeredBy;} + {_resourceGroupFilter = If( json?.PropertyT("resourceGroupFilter"), out var __jsonResourceGroupFilter) ? If( __jsonResourceGroupFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _resourceGroupFilter;} + {_resourceFilter = If( json?.PropertyT("resourceFilter"), out var __jsonResourceFilter) ? If( __jsonResourceFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _resourceFilter;} + {_meterFilter = If( json?.PropertyT("meterFilter"), out var __jsonMeterFilter) ? If( __jsonMeterFilter as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _meterFilter;} + {_tagFilter = If( json?.PropertyT("tagFilter"), out var __jsonTagFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Any.FromJson(__jsonTagFilter) : _tagFilter;} + {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (decimal?)__jsonThreshold : _threshold;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (decimal?)__jsonAmount : _amount;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)_unit;} + {_currentSpend = If( json?.PropertyT("currentSpend"), out var __jsonCurrentSpend) ? (decimal?)__jsonCurrentSpend : _currentSpend;} + {_contactEmail = If( json?.PropertyT("contactEmails"), out var __jsonContactEmails) ? If( __jsonContactEmails as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _contactEmail;} + {_contactGroup = If( json?.PropertyT("contactGroups"), out var __jsonContactGroups) ? If( __jsonContactGroups as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _contactGroup;} + {_contactRole = If( json?.PropertyT("contactRoles"), out var __jsonContactRoles) ? If( __jsonContactRoles as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : _contactRole;} + {_overridingAlert = If( json?.PropertyT("overridingAlert"), out var __jsonOverridingAlert) ? (string)__jsonOverridingAlert : (string)_overridingAlert;} + {_departmentName = If( json?.PropertyT("departmentName"), out var __jsonDepartmentName) ? (string)__jsonDepartmentName : (string)_departmentName;} + {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)_companyName;} + {_enrollmentNumber = If( json?.PropertyT("enrollmentNumber"), out var __jsonEnrollmentNumber) ? (string)__jsonEnrollmentNumber : (string)_enrollmentNumber;} + {_enrollmentStartDate = If( json?.PropertyT("enrollmentStartDate"), out var __jsonEnrollmentStartDate) ? (string)__jsonEnrollmentStartDate : (string)_enrollmentStartDate;} + {_enrollmentEndDate = If( json?.PropertyT("enrollmentEndDate"), out var __jsonEnrollmentEndDate) ? (string)__jsonEnrollmentEndDate : (string)_enrollmentEndDate;} + {_invoicingThreshold = If( json?.PropertyT("invoicingThreshold"), out var __jsonInvoicingThreshold) ? (decimal?)__jsonInvoicingThreshold : _invoicingThreshold;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new AlertPropertiesDetails(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.PowerShell.cs similarity index 71% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.PowerShell.cs index 03dcb9fa6a41..9a6a59e246f8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AlertsResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal AlertsResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,37 +103,37 @@ internal AlertsResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertsResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertsResult(content); } @@ -135,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of alerts. [System.ComponentModel.TypeConverter(typeof(AlertsResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.TypeConverter.cs index 3ff2523bce96..42a3a6c41dbe 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.cs similarity index 72% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.cs index 3c5d1a3431b1..de655698fa85 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Result of alerts. public partial class AlertsResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class AlertsResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[] _value; + private System.Collections.Generic.List _value; /// List of alerts. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public AlertsResult() @@ -47,6 +47,9 @@ public partial interface IAlertsResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next set of alerts results if there are any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IAlertsResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of alerts.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert) })] + System.Collections.Generic.List Value { get; } } /// Result of alerts. @@ -68,7 +74,7 @@ public partial interface IAlertsResultInternal /// URL to get the next set of alerts results if there are any. string NextLink { get; set; } /// List of alerts. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.json.cs index cc3c6c6d37ac..b4de9e7967a5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertsResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/AlertsResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlertsResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Alert.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlert) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Alert.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new AlertsResult(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.PowerShell.cs index a64ca8e45839..b635e30d4808 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny Dese /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.cs index 04cf4936715a..f1da5755a7b0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable { } - /// Any object + /// Anything public partial interface IAnyInternal { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.json.cs index 02aaa8963882..da0916351eb7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.PowerShell.cs deleted file mode 100644 index 296b02ca44c2..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Alert.PowerShell.cs +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// An individual alert. - [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] - public partial class Alert - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Alert(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Alert(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Alert(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Alert(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlert FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// An individual alert. - [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] - public partial interface IAlert - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs deleted file mode 100644 index dc9e4745acc2..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// Alert properties. - [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] - public partial class AlertProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal AlertProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Alert properties. - [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] - public partial interface IAlertProperties - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs deleted file mode 100644 index b138983d23ef..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// Alert details - [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailsTypeConverter))] - public partial class AlertPropertiesDetails - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal AlertPropertiesDetails(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("PeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("TriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("ResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (string[]) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter = (string[]) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter = (string[]) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("Threshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("Operator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("Amount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("Unit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); - } - if (content.Contains("CurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("ContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("OverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); - } - if (content.Contains("CompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("InvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertPropertiesDetails(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("PeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("TriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("ResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (string[]) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter = (string[]) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter = (string[]) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("Threshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("Operator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("Amount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("Unit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); - } - if (content.Contains("CurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("ContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("OverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); - } - if (content.Contains("CompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("EnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("InvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertPropertiesDetails(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertPropertiesDetails(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Alert details - [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailsTypeConverter))] - public partial interface IAlertPropertiesDetails - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs deleted file mode 100644 index 72dfd9d7cde1..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The common properties of the export. - [System.ComponentModel.TypeConverter(typeof(CommonExportPropertiesTypeConverter))] - public partial class CommonExportProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CommonExportProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CommonExportProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CommonExportProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CommonExportProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The common properties of the export. - [System.ComponentModel.TypeConverter(typeof(CommonExportPropertiesTypeConverter))] - public partial interface ICommonExportProperties - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs deleted file mode 100644 index f2df07ee6f4e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs +++ /dev/null @@ -1,432 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The request payload to update an alert - [System.ComponentModel.TypeConverter(typeof(DismissAlertPayloadTypeConverter))] - public partial class DismissAlertPayload - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DismissAlertPayload(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DismissAlertPayload(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DismissAlertPayload(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DismissAlertPayload(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource.CreateFrom); - } - if (content.Contains("CostEntityId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus.CreateFrom); - } - if (content.Contains("CreationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); - } - if (content.Contains("CloseTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); - } - if (content.Contains("ModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); - } - if (content.Contains("StatusModificationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType.CreateFrom); - } - if (content.Contains("DefinitionCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory.CreateFrom); - } - if (content.Contains("DefinitionCriterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria.CreateFrom); - } - if (content.Contains("DetailTimeGrainType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType.CreateFrom); - } - if (content.Contains("DetailPeriodStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailTriggeredBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); - } - if (content.Contains("DetailResourceGroupFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (string[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailResourceFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter = (string[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailMeterFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter = (string[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailTagFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator.CreateFrom); - } - if (content.Contains("DetailAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); - } - if (content.Contains("DetailCurrentSpend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - if (content.Contains("DetailContactEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailContactRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailOverridingAlert")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); - } - if (content.Contains("DetailDepartmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); - } - if (content.Contains("DetailCompanyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); - } - if (content.Contains("DetailEnrollmentEndDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); - } - if (content.Contains("DetailInvoicingThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The request payload to update an alert - [System.ComponentModel.TypeConverter(typeof(DismissAlertPayloadTypeConverter))] - public partial interface IDismissAlertPayload - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.PowerShell.cs deleted file mode 100644 index 5fc430cf151b..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.PowerShell.cs +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// An export resource. - [System.ComponentModel.TypeConverter(typeof(ExportTypeConverter))] - public partial class Export - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Export(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Export(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Export(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Schedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("ScheduleRecurrencePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); - } - if (content.Contains("ScheduleRecurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("RecurrencePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrencePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Export(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Schedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("ScheduleRecurrencePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); - } - if (content.Contains("ScheduleRecurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("RecurrencePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrencePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// An export resource. - [System.ComponentModel.TypeConverter(typeof(ExportTypeConverter))] - public partial interface IExport - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs deleted file mode 100644 index ddaa3f3d1e4e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs +++ /dev/null @@ -1,440 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// An export execution. - [System.ComponentModel.TypeConverter(typeof(ExportExecutionTypeConverter))] - public partial class ExportExecution - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExportExecution(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExportExecution(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExportExecution(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("ExecutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType.CreateFrom); - } - if (content.Contains("RunSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus.CreateFrom); - } - if (content.Contains("SubmittedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); - } - if (content.Contains("SubmittedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FileName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); - } - if (content.Contains("RunSettingDeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingRunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("RunSettingPartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunSettingNextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ExportExecution(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("ExecutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType.CreateFrom); - } - if (content.Contains("RunSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus.CreateFrom); - } - if (content.Contains("SubmittedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); - } - if (content.Contains("SubmittedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FileName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); - } - if (content.Contains("RunSettingDeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingRunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("RunSettingPartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunSettingNextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// An export execution. - [System.ComponentModel.TypeConverter(typeof(ExportExecutionTypeConverter))] - public partial interface IExportExecution - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs deleted file mode 100644 index 0b17a6caffdd..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The properties of the export execution. - [System.ComponentModel.TypeConverter(typeof(ExportExecutionPropertiesTypeConverter))] - public partial class ExportExecutionProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExportExecutionProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExportExecutionProperties(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExportExecutionProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RunSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ExecutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus.CreateFrom); - } - if (content.Contains("SubmittedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); - } - if (content.Contains("SubmittedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FileName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); - } - if (content.Contains("RunSettingDeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingRunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("RunSettingPartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunSettingNextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ExportExecutionProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RunSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ExecutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus.CreateFrom); - } - if (content.Contains("SubmittedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); - } - if (content.Contains("SubmittedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProcessingEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FileName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); - } - if (content.Contains("RunSettingDeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingRunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("RunSettingFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("RunSettingPartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunSettingNextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The properties of the export execution. - [System.ComponentModel.TypeConverter(typeof(ExportExecutionPropertiesTypeConverter))] - public partial interface IExportExecutionProperties - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs deleted file mode 100644 index f52516260f6a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The properties of the export. - [System.ComponentModel.TypeConverter(typeof(ExportPropertiesTypeConverter))] - public partial class ExportProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExportProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExportProperties(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExportProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Schedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScheduleRecurrencePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); - } - if (content.Contains("ScheduleRecurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); - } - if (content.Contains("RecurrencePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrencePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ExportProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Schedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryInfoDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("DefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("DefinitionTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("RunHistoryValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); - } - if (content.Contains("DestinationResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); - } - if (content.Contains("DestinationContainer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); - } - if (content.Contains("DestinationRootFolderPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); - } - if (content.Contains("DestinationSasToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DeliveryInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Definition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RunHistory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); - } - if (content.Contains("Format")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType.CreateFrom); - } - if (content.Contains("PartitionData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("NextRunTimeEstimate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScheduleRecurrencePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); - } - if (content.Contains("ScheduleRecurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); - } - if (content.Contains("RecurrencePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrencePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The properties of the export. - [System.ComponentModel.TypeConverter(typeof(ExportPropertiesTypeConverter))] - public partial interface IExportProperties - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.cs deleted file mode 100644 index dfcbbe9b6c18..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; - - /// The properties of the export. - public partial class ExportProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties(); - - /// - /// Array of column names to be included in the export. If not provided then the export will include all available columns. - /// The available columns can vary by customer channel (see examples). - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn = value ?? null /* arrayOf */; } - - /// The export dataset configuration. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration = value ?? null /* model class */; } - - /// The granularity of rows in the export. Currently only 'Daily' is supported. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } - - /// Has the definition for the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Definition = value ; } - - /// The definition for data in the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet = value ?? null /* model class */; } - - /// Has time period for pulling data for the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod = value ?? null /* model class */; } - - /// - /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimeframe = value ; } - - /// - /// 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. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType = value ; } - - /// Has delivery information for the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo = value ; } - - /// Has destination for the export being delivered. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination = value ; } - - /// - /// The name of the container where exports will be uploaded. If the container does not exist it will be created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationContainer = value ; } - - /// - /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount - /// are specified. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId = value ?? null; } - - /// The name of the directory where exports will be uploaded. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationRootFolderPath = value ?? null; } - - /// - /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be - /// specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning - /// this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be - /// specified. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationSasToken = value ?? null; } - - /// - /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken - /// can be specified instead of resourceId. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount = value ?? null; } - - /// The format of the export being delivered. Currently only 'Csv' is supported. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); } - - /// Internal Acessors for NextRunTimeEstimate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate = value; } - - /// Internal Acessors for RunHistoryValue - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue = value; } - - /// Internal Acessors for Schedule - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportSchedule()); set { {_schedule = value;} } } - - /// Internal Acessors for ScheduleRecurrencePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriod = value; } - - /// - /// If the export has an active schedule, provides an estimate of the next execution time. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate; } - - /// - /// 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 modern commerce scopes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData = value ?? default(bool); } - - /// The start date of recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } - - /// The end date of recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodTo = value ?? default(global::System.DateTime); } - - /// If requested, has the most recent execution history for the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory = value ?? null /* model class */; } - - /// A list of export executions. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule _schedule; - - /// Has schedule information for the export. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportSchedule()); set => this._schedule = value; } - - /// The schedule recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).Recurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).Recurrence = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType)""); } - - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)Schedule).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType)""); } - - /// The start date for export data. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom = value ?? default(global::System.DateTime); } - - /// The end date for export data. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodTo = value ?? default(global::System.DateTime); } - - /// Creates an new instance. - public ExportProperties() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__commonExportProperties), __commonExportProperties); - await eventListener.AssertObjectIsValid(nameof(__commonExportProperties), __commonExportProperties); - } - } - /// The properties of the export. - public partial interface IExportProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties - { - /// The start date of recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The start date of recurrence.", - SerializedName = @"from", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RecurrencePeriodFrom { get; set; } - /// The end date of recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The end date of recurrence.", - SerializedName = @"to", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RecurrencePeriodTo { get; set; } - /// The schedule recurrence. - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The schedule recurrence.", - SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get; set; } - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get; set; } - - } - /// The properties of the export. - public partial interface IExportPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal - { - /// The start date of recurrence. - global::System.DateTime? RecurrencePeriodFrom { get; set; } - /// The end date of recurrence. - global::System.DateTime? RecurrencePeriodTo { get; set; } - /// Has schedule information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule Schedule { get; set; } - /// The schedule recurrence. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get; set; } - /// - /// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than - /// start date. - /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod ScheduleRecurrencePeriod { get; set; } - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get; set; } - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs deleted file mode 100644 index 795db13f8945..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The definition of data present in the forecast. - [System.ComponentModel.TypeConverter(typeof(ForecastDatasetTypeConverter))] - public partial class ForecastDataset - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ForecastDataset(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ForecastDataset(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ForecastDataset(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Filter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); - } - if (content.Contains("Granularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("Aggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("FilterDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterAnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("FilterOr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("DimensionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); - } - if (content.Contains("DimensionOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); - } - if (content.Contains("DimensionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); - } - if (content.Contains("TagOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); - } - if (content.Contains("TagValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ForecastDataset(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Filter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); - } - if (content.Contains("Granularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("Aggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("FilterDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterAnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("FilterOr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("DimensionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); - } - if (content.Contains("DimensionOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); - } - if (content.Contains("DimensionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); - } - if (content.Contains("TagOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); - } - if (content.Contains("TagValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The definition of data present in the forecast. - [System.ComponentModel.TypeConverter(typeof(ForecastDatasetTypeConverter))] - public partial interface IForecastDataset - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs deleted file mode 100644 index c2db98ea7dcd..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The definition of a forecast. - [System.ComponentModel.TypeConverter(typeof(ForecastDefinitionTypeConverter))] - public partial class ForecastDefinition - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ForecastDefinition(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ForecastDefinition(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ForecastDefinition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType.CreateFrom); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); - } - if (content.Contains("IncludeActualCost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IncludeFreshPartialCost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatasetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("DatasetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("FilterDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterAnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("FilterOr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("DimensionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); - } - if (content.Contains("DimensionOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); - } - if (content.Contains("DimensionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); - } - if (content.Contains("TagOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); - } - if (content.Contains("TagValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ForecastDefinition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType.CreateFrom); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); - } - if (content.Contains("IncludeActualCost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("IncludeFreshPartialCost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatasetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("DatasetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("FilterDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); - } - if (content.Contains("FilterAnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("FilterOr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); - } - if (content.Contains("DimensionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); - } - if (content.Contains("DimensionOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); - } - if (content.Contains("DimensionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TagName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); - } - if (content.Contains("TagOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); - } - if (content.Contains("TagValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The definition of a forecast. - [System.ComponentModel.TypeConverter(typeof(ForecastDefinitionTypeConverter))] - public partial interface IForecastDefinition - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs deleted file mode 100644 index d56acd832103..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The definition of a query. - [System.ComponentModel.TypeConverter(typeof(QueryDefinitionTypeConverter))] - public partial class QueryDefinition - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new QueryDefinition(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new QueryDefinition(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal QueryDefinition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatasetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("DatasetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DatasetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal QueryDefinition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatasetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); - } - if (content.Contains("DatasetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DatasetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DatasetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The definition of a query. - [System.ComponentModel.TypeConverter(typeof(QueryDefinitionTypeConverter))] - public partial interface IQueryDefinition - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs deleted file mode 100644 index e382e41e4753..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The definition of a report config. - [System.ComponentModel.TypeConverter(typeof(ReportConfigDefinitionTypeConverter))] - public partial class ReportConfigDefinition - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReportConfigDefinition(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReportConfigDefinition(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReportConfigDefinition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("IncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReportConfigDefinition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("TimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("DataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Timeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("IncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The definition of a report config. - [System.ComponentModel.TypeConverter(typeof(ReportConfigDefinitionTypeConverter))] - public partial interface IReportConfigDefinition - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.PowerShell.cs deleted file mode 100644 index c3b37c124499..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.PowerShell.cs +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// States and configurations of Cost Analysis. - [System.ComponentModel.TypeConverter(typeof(ViewTypeConverter))] - public partial class View - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new View(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new View(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal View(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("Query")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ModifiedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DateRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DateRange, global::System.Convert.ToString); - } - if (content.Contains("Currency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Currency, global::System.Convert.ToString); - } - if (content.Contains("Chart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType.CreateFrom); - } - if (content.Contains("Accumulated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType.CreateFrom); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType.CreateFrom); - } - if (content.Contains("Kpi")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Pivot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("QueryTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("QueryDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("QueryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryType, global::System.Convert.ToString); - } - if (content.Contains("QueryTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("QueryIncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal View(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ETag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); - } - if (content.Contains("Query")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ModifiedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DateRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DateRange, global::System.Convert.ToString); - } - if (content.Contains("Currency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Currency, global::System.Convert.ToString); - } - if (content.Contains("Chart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType.CreateFrom); - } - if (content.Contains("Accumulated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType.CreateFrom); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType.CreateFrom); - } - if (content.Contains("Kpi")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Pivot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("QueryTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("QueryDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("QueryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryType, global::System.Convert.ToString); - } - if (content.Contains("QueryTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("QueryIncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - } - /// States and configurations of Cost Analysis. - [System.ComponentModel.TypeConverter(typeof(ViewTypeConverter))] - public partial interface IView - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs deleted file mode 100644 index 73a966734398..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The properties of the view. - [System.ComponentModel.TypeConverter(typeof(ViewPropertiesTypeConverter))] - public partial class ViewProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ViewProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ViewProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ViewProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Query")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ModifiedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DateRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); - } - if (content.Contains("Currency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); - } - if (content.Contains("Chart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType.CreateFrom); - } - if (content.Contains("Accumulated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType.CreateFrom); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType.CreateFrom); - } - if (content.Contains("Kpi")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Pivot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("QueryTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("QueryDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("QueryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryType, global::System.Convert.ToString); - } - if (content.Contains("QueryTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("QueryIncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ViewProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Query")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ModifiedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DateRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); - } - if (content.Contains("Currency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); - } - if (content.Contains("Chart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType.CreateFrom); - } - if (content.Contains("Accumulated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType.CreateFrom); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType.CreateFrom); - } - if (content.Contains("Kpi")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Pivot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); - } - if (content.Contains("QueryTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("QueryDataSet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); - } - if (content.Contains("QueryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryType, global::System.Convert.ToString); - } - if (content.Contains("QueryTimeframe")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryTimeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType.CreateFrom); - } - if (content.Contains("QueryIncludeMonetaryCommitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TimePeriodFrom")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TimePeriodTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DataSetConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGranularity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); - } - if (content.Contains("DataSetAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); - } - if (content.Contains("DataSetGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetSorting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); - } - if (content.Contains("DataSetFilter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationColumn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - } - /// The properties of the view. - [System.ComponentModel.TypeConverter(typeof(ViewPropertiesTypeConverter))] - public partial interface IViewProperties - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs deleted file mode 100644 index 753a6e2b0cea..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The result of the long running operation for cost details Api. - [System.ComponentModel.TypeConverter(typeof(CostDetailsOperationResultsTypeConverter))] - public partial class CostDetailsOperationResults - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CostDetailsOperationResults(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Manifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifestTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType.CreateFrom); - } - if (content.Contains("ValidTill")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ManifestRequestContext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); - } - if (content.Contains("ManifestDataFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat?) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat.CreateFrom); - } - if (content.Contains("ManifestByteCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManifestBlobCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManifestCompressData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ManifestBlob")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestContextRequestScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("RequestContextRequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); - } - if (content.Contains("RequestBodyBillingPeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); - } - if (content.Contains("RequestBodyInvoiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CostDetailsOperationResults(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Manifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifestTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType.CreateFrom); - } - if (content.Contains("ValidTill")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ManifestRequestContext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); - } - if (content.Contains("ManifestDataFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat?) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat.CreateFrom); - } - if (content.Contains("ManifestByteCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManifestBlobCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManifestCompressData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ManifestBlob")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestContextRequestScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("RequestContextRequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); - } - if (content.Contains("RequestBodyBillingPeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); - } - if (content.Contains("RequestBodyInvoiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CostDetailsOperationResults(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CostDetailsOperationResults(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The result of the long running operation for cost details Api. - [System.ComponentModel.TypeConverter(typeof(CostDetailsOperationResultsTypeConverter))] - public partial interface ICostDetailsOperationResults - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs deleted file mode 100644 index 667f23044f30..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 -{ - using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; - - /// The manifest of the report generated by the operation. - [System.ComponentModel.TypeConverter(typeof(ReportManifestTypeConverter))] - public partial class ReportManifest - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReportManifest(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReportManifest(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReportManifest(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RequestContext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); - } - if (content.Contains("DataFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat?) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat.CreateFrom); - } - if (content.Contains("ByteCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("BlobCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CompressData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Blob")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestContextRequestScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); - } - if (content.Contains("RequestContextRequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); - } - if (content.Contains("RequestBodyBillingPeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); - } - if (content.Contains("RequestBodyInvoiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReportManifest(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RequestContext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); - } - if (content.Contains("ManifestVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); - } - if (content.Contains("DataFormat")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat?) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat.CreateFrom); - } - if (content.Contains("ByteCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("BlobCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CompressData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Blob")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestContextRequestScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); - } - if (content.Contains("RequestContextRequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyTimePeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); - } - if (content.Contains("RequestBodyMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); - } - if (content.Contains("RequestBodyBillingPeriod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); - } - if (content.Contains("RequestBodyInvoiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); - } - if (content.Contains("TimePeriodEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The manifest of the report generated by the operation. - [System.ComponentModel.TypeConverter(typeof(ReportManifestTypeConverter))] - public partial interface IReportManifest - - { - - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.PowerShell.cs index aa44049406a2..98956f36afa0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BlobInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal BlobInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("BlobLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); } if (content.Contains("ByteCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,37 +103,37 @@ internal BlobInfo(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("BlobLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); } if (content.Contains("ByteCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BlobInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BlobInfo(content); } @@ -135,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202205 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The blob information generated by this operation. [System.ComponentModel.TypeConverter(typeof(BlobInfoTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.TypeConverter.cs index 5eab9a6dfafe..cfe95c9dd3fb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.cs index f167b6efde7c..56be7c9826c7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The blob information generated by this operation. public partial class BlobInfo : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfoInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IBlobInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the blob to download file.", SerializedName = @"blobLink", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IBlobInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Bytes in the blob.", SerializedName = @"byteCount", PossibleTypes = new [] { typeof(long) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.json.cs index 6bd86aca12af..22619c9d64d2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/BlobInfo.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/BlobInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BlobInfo(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json { return; } - {_blobLink = If( json?.PropertyT("blobLink"), out var __jsonBlobLink) ? (string)__jsonBlobLink : (string)BlobLink;} - {_byteCount = If( json?.PropertyT("byteCount"), out var __jsonByteCount) ? (long?)__jsonByteCount : ByteCount;} + {_blobLink = If( json?.PropertyT("blobLink"), out var __jsonBlobLink) ? (string)__jsonBlobLink : (string)_blobLink;} + {_byteCount = If( json?.PropertyT("byteCount"), out var __jsonByteCount) ? (long?)__jsonByteCount : _byteCount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new BlobInfo(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.PowerShell.cs new file mode 100644 index 000000000000..41223fb04fc7 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.PowerShell.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The common properties of the export. + [System.ComponentModel.TypeConverter(typeof(CommonExportPropertiesTypeConverter))] + public partial class CommonExportProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CommonExportProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CommonExportProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CommonExportProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CommonExportProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The common properties of the export. + [System.ComponentModel.TypeConverter(typeof(CommonExportPropertiesTypeConverter))] + public partial interface ICommonExportProperties + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.TypeConverter.cs index 32b4e7e8fffc..6f1a1df6ed61 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.cs index f022e2b1c385..5f41969ac78f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The common properties of the export. public partial class CommonExportProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal { /// @@ -18,55 +18,55 @@ public partial class CommonExportProperties : /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).ConfigurationColumn = value ?? null /* arrayOf */; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSetGranularity = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition _definition; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition _definition; /// Has the definition for the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinition()); set => this._definition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinition()); set => this._definition = value; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).Timeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).Timeframe = value ; } + public string DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).Timeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).Timeframe = value ; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).Type = value ; } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).Type = value ; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo _deliveryInfo; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo _deliveryInfo; /// Has delivery information for the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfo()); set => this._deliveryInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfo()); set => this._deliveryInfo = value; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationContainer = value ; } + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationContainer = value ; } /// /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount /// are specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId = value ?? null; } + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId = value ?? null; } /// The name of the directory where exports will be uploaded. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationRootFolderPath = value ?? null; } + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationRootFolderPath = value ?? null; } /// /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be @@ -75,48 +75,48 @@ public partial class CommonExportProperties : /// specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationSasToken = value ?? null; } + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationSasToken = value ?? null; } /// /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken /// can be specified instead of resourceId. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount = value ?? null; } + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? _format; + private string _format; /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get => this._format; set => this._format = value; } + public string Format { get => this._format; set => this._format = value; } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSetConfiguration = value; } /// Internal Acessors for Definition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinition()); set { {_definition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinition()); set { {_definition = value;} } } /// Internal Acessors for DefinitionDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).DataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).DataSet = value; } /// Internal Acessors for DefinitionTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriod = value; } /// Internal Acessors for DeliveryInfo - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfo()); set { {_deliveryInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfo()); set { {_deliveryInfo = value;} } } /// Internal Acessors for DeliveryInfoDestination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).Destination = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)DeliveryInfo).Destination = value; } /// Internal Acessors for NextRunTimeEstimate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => this._nextRunTimeEstimate; set { {_nextRunTimeEstimate = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => this._nextRunTimeEstimate; set { {_nextRunTimeEstimate = value;} } } /// Internal Acessors for RunHistory - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResult()); set { {_runHistory = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResult()); set { {_runHistory = value;} } } /// Internal Acessors for RunHistoryValue - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)RunHistory).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)RunHistory).Value = value; } /// Backing field for property. private global::System.DateTime? _nextRunTimeEstimate; @@ -138,23 +138,23 @@ public partial class CommonExportProperties : public bool? PartitionData { get => this._partitionData; set => this._partitionData = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult _runHistory; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult _runHistory; /// If requested, has the most recent execution history for the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResult()); set => this._runHistory = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResult()); set => this._runHistory = value; } /// A list of export executions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value; } + public System.Collections.Generic.List RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)RunHistory).Value; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)Definition).TimePeriodTo = value ?? default(global::System.DateTime); } /// Creates an new instance. public CommonExportProperties() @@ -173,28 +173,39 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. @@ -202,16 +213,23 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -223,6 +241,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -231,6 +252,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -244,6 +268,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -255,6 +282,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] @@ -263,16 +293,23 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string Format { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"If the export has an active schedule, provides an estimate of the next execution time.", SerializedName = @"nextRunTimeEstimate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -284,6 +321,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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 modern commerce scopes.", SerializedName = @"partitionData", PossibleTypes = new [] { typeof(bool) })] @@ -292,14 +332,20 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"A list of export executions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) })] + System.Collections.Generic.List RunHistoryValue { get; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -308,6 +354,9 @@ public partial interface ICommonExportProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -322,30 +371,33 @@ public partial interface ICommonExportPropertiesInternal /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// Has the definition for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Definition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Definition { get; set; } /// The definition for data in the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DefinitionDataSet { get; set; } /// Has time period for pulling data for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DefinitionTimePeriod { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// Has delivery information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeliveryInfo { get; set; } /// Has destination for the export being delivered. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeliveryInfoDestination { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// @@ -370,7 +422,8 @@ public partial interface ICommonExportPropertiesInternal /// string DestinationStorageAccount { get; set; } /// The format of the export being delivered. Currently only 'Csv' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string Format { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// @@ -381,9 +434,9 @@ public partial interface ICommonExportPropertiesInternal /// bool? PartitionData { get; set; } /// If requested, has the most recent execution history for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunHistory { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunHistory { get; set; } /// A list of export executions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + System.Collections.Generic.List RunHistoryValue { get; set; } /// The start date for export data. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date for export data. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.json.cs index 1744feff7314..7ac09c32b02b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/CommonExportProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CommonExportProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,23 +65,23 @@ internal CommonExportProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_deliveryInfo = If( json?.PropertyT("deliveryInfo"), out var __jsonDeliveryInfo) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryInfo.FromJson(__jsonDeliveryInfo) : DeliveryInfo;} - {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDefinition.FromJson(__jsonDefinition) : Definition;} - {_runHistory = If( json?.PropertyT("runHistory"), out var __jsonRunHistory) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionListResult.FromJson(__jsonRunHistory) : RunHistory;} - {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)Format;} - {_partitionData = If( json?.PropertyT("partitionData"), out var __jsonPartitionData) ? (bool?)__jsonPartitionData : PartitionData;} - {_nextRunTimeEstimate = If( json?.PropertyT("nextRunTimeEstimate"), out var __jsonNextRunTimeEstimate) ? global::System.DateTime.TryParse((string)__jsonNextRunTimeEstimate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNextRunTimeEstimateValue) ? __jsonNextRunTimeEstimateValue : NextRunTimeEstimate : NextRunTimeEstimate;} + {_deliveryInfo = If( json?.PropertyT("deliveryInfo"), out var __jsonDeliveryInfo) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfo.FromJson(__jsonDeliveryInfo) : _deliveryInfo;} + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinition.FromJson(__jsonDefinition) : _definition;} + {_runHistory = If( json?.PropertyT("runHistory"), out var __jsonRunHistory) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResult.FromJson(__jsonRunHistory) : _runHistory;} + {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)_format;} + {_partitionData = If( json?.PropertyT("partitionData"), out var __jsonPartitionData) ? (bool?)__jsonPartitionData : _partitionData;} + {_nextRunTimeEstimate = If( json?.PropertyT("nextRunTimeEstimate"), out var __jsonNextRunTimeEstimate) ? global::System.DateTime.TryParse((string)__jsonNextRunTimeEstimate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNextRunTimeEstimateValue) ? __jsonNextRunTimeEstimateValue : _nextRunTimeEstimate : _nextRunTimeEstimate;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new CommonExportProperties(json) : null; } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T AddIf( null != this._runHistory ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._runHistory.ToJson(null,serializationMode) : null, "runHistory" ,container.Add ); AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); AddIf( null != this._partitionData ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonBoolean((bool)this._partitionData) : null, "partitionData" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._nextRunTimeEstimate ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._nextRunTimeEstimate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "nextRunTimeEstimate" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.PowerShell.cs new file mode 100644 index 000000000000..3a17dc93a263 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.PowerShell.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The result of the long running operation for cost details Api. + [System.ComponentModel.TypeConverter(typeof(CostDetailsOperationResultsTypeConverter))] + public partial class CostDetailsOperationResults + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CostDetailsOperationResults(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Manifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifestTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ManifestRequestContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("ManifestDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (string) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, global::System.Convert.ToString); + } + if (content.Contains("ManifestByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManifestBlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManifestCompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManifestBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlob = (System.Collections.Generic.List) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodEnd, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CostDetailsOperationResults(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Manifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifestTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ManifestRequestContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("ManifestDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (string) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, global::System.Convert.ToString); + } + if (content.Contains("ManifestByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManifestBlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManifestCompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManifestBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlob = (System.Collections.Generic.List) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal)this).TimePeriodEnd, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CostDetailsOperationResults(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CostDetailsOperationResults(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The result of the long running operation for cost details Api. + [System.ComponentModel.TypeConverter(typeof(CostDetailsOperationResultsTypeConverter))] + public partial interface ICostDetailsOperationResults + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.TypeConverter.cs index 8ae820070716..81f5e9d2ce18 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.cs index 0c2a3c05f25a..a60392cbe4b8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.cs @@ -3,26 +3,26 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The result of the long running operation for cost details Api. public partial class CostDetailsOperationResults : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails _error; /// The details of the error. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set => this._error = value; } /// Backing field for property. private string _id; @@ -32,60 +32,60 @@ public partial class CostDetailsOperationResults : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest _manifest; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest _manifest; /// The manifest of the report generated by the operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifest()); set => this._manifest = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifest()); set => this._manifest = value; } /// List of blob information generated by this operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] ManifestBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).Blob = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ManifestBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).Blob = value ?? null /* arrayOf */; } /// The total number of blobs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public int? ManifestBlobCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).BlobCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).BlobCount = value ?? default(int); } + public int? ManifestBlobCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).BlobCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).BlobCount = value ?? default(int); } /// The total number of bytes in all blobs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public long? ManifestByteCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).ByteCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).ByteCount = value ?? default(long); } + public long? ManifestByteCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).ByteCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).ByteCount = value ?? default(long); } /// Is the data in compressed format. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? ManifestCompressData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).CompressData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).CompressData = value ?? default(bool); } + public bool? ManifestCompressData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).CompressData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).CompressData = value ?? default(bool); } /// The data format of the report [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? ManifestDataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).DataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).DataFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat)""); } + public string ManifestDataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).DataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).DataFormat = value ?? null; } /// The Manifest version. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string ManifestVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).ManifestVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).ManifestVersion = value ?? null; } + public string ManifestVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).ManifestVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).ManifestVersion = value ?? null; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Manifest - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifest()); set { {_manifest = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifest()); set { {_manifest = value;} } } /// Internal Acessors for ManifestRequestContext - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.ManifestRequestContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContext = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.ManifestRequestContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContext = value; } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message = value; } /// Internal Acessors for RequestBodyTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyTimePeriod = value; } /// Internal Acessors for RequestContextRequestBody - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResultsInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestBody = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResultsInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContextRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContextRequestBody = value; } /// Backing field for property. private string _name; @@ -100,7 +100,7 @@ public partial class CostDetailsOperationResults : /// is not provided in the request body the API will return the current month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyBillingPeriod = value ?? null; } + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyBillingPeriod = value ?? null; } /// /// This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing @@ -109,30 +109,34 @@ public partial class CostDetailsOperationResults : /// month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyInvoiceId = value ?? null; } + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyInvoiceId = value ?? null; } /// The type of the detailed report. By default ActualCost is provided [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyMetric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType)""); } + public string RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestBodyMetric = value ?? null; } /// The request scope of the request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestScope = value ?? null; } + public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContextRequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).RequestContextRequestScope = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType? _status; + private string _status; /// The status of the cost details operation [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodEnd = value ?? null; } + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).TimePeriodEnd = value ?? null; } /// The start date to pull data from. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodStart = value ?? null; } + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)Manifest).TimePeriodStart = value ?? null; } /// Backing field for property. private string _type; @@ -164,6 +168,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +179,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the long running operation.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -180,14 +190,20 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of blob information generated by this operation.", SerializedName = @"blobs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] ManifestBlob { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo) })] + System.Collections.Generic.List ManifestBlob { get; set; } /// The total number of blobs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total number of blobs.", SerializedName = @"blobCount", PossibleTypes = new [] { typeof(int) })] @@ -196,6 +212,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total number of bytes in all blobs.", SerializedName = @"byteCount", PossibleTypes = new [] { typeof(long) })] @@ -204,6 +223,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Is the data in compressed format.", SerializedName = @"compressData", PossibleTypes = new [] { typeof(bool) })] @@ -212,14 +234,21 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The data format of the report", SerializedName = @"dataFormat", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? ManifestDataFormat { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string ManifestDataFormat { get; set; } /// The Manifest version. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Manifest version.", SerializedName = @"manifestVersion", PossibleTypes = new [] { typeof(string) })] @@ -228,6 +257,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -236,6 +268,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the long running operation.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +283,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"billingPeriod", PossibleTypes = new [] { typeof(string) })] @@ -261,6 +299,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"invoiceId", PossibleTypes = new [] { typeof(string) })] @@ -269,14 +310,21 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the detailed report. By default ActualCost is provided", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// The request scope of the request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The request scope of the request.", SerializedName = @"requestScope", PossibleTypes = new [] { typeof(string) })] @@ -285,14 +333,21 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the cost details operation", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Completed", "NoDataFound", "Failed")] + string Status { get; set; } /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to. example format 2020-03-15", SerializedName = @"end", PossibleTypes = new [] { typeof(string) })] @@ -301,6 +356,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from. example format 2020-03-15", SerializedName = @"start", PossibleTypes = new [] { typeof(string) })] @@ -309,6 +367,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the long running operation.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -319,6 +380,9 @@ public partial interface ICostDetailsOperationResults : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.", SerializedName = @"validTill", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -332,13 +396,13 @@ public partial interface ICostDetailsOperationResultsInternal /// Error code. string Code { get; set; } /// The details of the error. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get; set; } /// The id of the long running operation. string Id { get; set; } /// The manifest of the report generated by the operation. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest Manifest { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest Manifest { get; set; } /// List of blob information generated by this operation. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] ManifestBlob { get; set; } + System.Collections.Generic.List ManifestBlob { get; set; } /// The total number of blobs. int? ManifestBlobCount { get; set; } /// The total number of bytes in all blobs. @@ -346,9 +410,10 @@ public partial interface ICostDetailsOperationResultsInternal /// Is the data in compressed format. bool? ManifestCompressData { get; set; } /// The data format of the report - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? ManifestDataFormat { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string ManifestDataFormat { get; set; } /// The context of the Cost Details request. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext ManifestRequestContext { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext ManifestRequestContext { get; set; } /// The Manifest version. string ManifestVersion { get; set; } /// Error message indicating why the operation failed. @@ -369,20 +434,22 @@ public partial interface ICostDetailsOperationResultsInternal /// string RequestBodyInvoiceId { get; set; } /// The type of the detailed report. By default ActualCost is provided - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// /// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId /// or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body /// the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than /// 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } /// The request payload body provided in Cost Details call - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition RequestContextRequestBody { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition RequestContextRequestBody { get; set; } /// The request scope of the request. string RequestContextRequestScope { get; set; } /// The status of the cost details operation - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Completed", "NoDataFound", "Failed")] + string Status { get; set; } /// The end date to pull data to. example format 2020-03-15 string TimePeriodEnd { get; set; } /// The start date to pull data from. example format 2020-03-15 diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.json.cs index 28c2ba9da209..5154211ed76b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsOperationResults.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,24 +65,24 @@ internal CostDetailsOperationResults(Microsoft.Azure.PowerShell.Cmdlets.CostMana { return; } - {_manifest = If( json?.PropertyT("manifest"), out var __jsonManifest) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ReportManifest.FromJson(__jsonManifest) : Manifest;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_validTill = If( json?.PropertyT("validTill"), out var __jsonValidTill) ? global::System.DateTime.TryParse((string)__jsonValidTill, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidTillValue) ? __jsonValidTillValue : ValidTill : ValidTill;} + {_manifest = If( json?.PropertyT("manifest"), out var __jsonManifest) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportManifest.FromJson(__jsonManifest) : _manifest;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails.FromJson(__jsonError) : _error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_validTill = If( json?.PropertyT("validTill"), out var __jsonValidTill) ? global::System.DateTime.TryParse((string)__jsonValidTill, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidTillValue) ? __jsonValidTillValue : _validTill : _validTill;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new CostDetailsOperationResults(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.PowerShell.cs index 6cb5df08c8ec..053accb40bee 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,7 +58,15 @@ public partial class CostDetailsTimePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -73,17 +81,17 @@ internal CostDetailsTimePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).End, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -98,39 +106,37 @@ internal CostDetailsTimePeriod(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)this).End, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CostDetailsTimePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CostDetailsTimePeriod(content); } @@ -140,12 +146,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202205 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or /// less and no older than 13 months. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.TypeConverter.cs index 10ac4b14a668..f0dafab83fda 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.cs index f8fa8f93d8bd..99802890e764 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 /// less and no older than 13 months. /// public partial class CostDetailsTimePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface ICostDetailsTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to. example format 2020-03-15", SerializedName = @"end", PossibleTypes = new [] { typeof(string) })] @@ -53,6 +56,9 @@ public partial interface ICostDetailsTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from. example format 2020-03-15", SerializedName = @"start", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.json.cs index 08179224519a..fea71d3142d0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostDetailsTimePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -68,19 +68,19 @@ internal CostDetailsTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagement { return; } - {_start = If( json?.PropertyT("start"), out var __jsonStart) ? (string)__jsonStart : (string)Start;} - {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? (string)__jsonEnd : (string)End;} + {_start = If( json?.PropertyT("start"), out var __jsonStart) ? (string)__jsonStart : (string)_start;} + {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? (string)__jsonEnd : (string)_end;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new CostDetailsTimePeriod(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.PowerShell.cs index ff021e1d2a93..484f21e7d342 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class CostManagementIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -81,7 +89,7 @@ internal CostManagementIdentity(global::System.Collections.IDictionary content) } if (content.Contains("ExternalCloudProviderType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType?) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType = (string) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType, global::System.Convert.ToString); } if (content.Contains("ExternalCloudProviderId")) { @@ -138,7 +146,7 @@ internal CostManagementIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("ExternalCloudProviderType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType?) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType = (string) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentityInternal)this).ExternalCloudProviderType, global::System.Convert.ToString); } if (content.Contains("ExternalCloudProviderId")) { @@ -204,6 +212,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostMana /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(CostManagementIdentityTypeConverter))] public partial interface ICostManagementIdentity diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.cs index a932ff478dc6..cc49943db5bb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.cs @@ -51,14 +51,14 @@ public partial class CostManagementIdentity : public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType? _externalCloudProviderType; + private string _externalCloudProviderType; /// /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for /// linked account and 'externalBillingAccounts' for consolidated account. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType? ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + public string ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } /// Backing field for property. private string _id; @@ -111,6 +111,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert ID", SerializedName = @"alertId", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +122,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Enrollment ID (Legacy BillingAccount ID)", SerializedName = @"billingAccountId", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +133,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"BillingProfile ID", SerializedName = @"billingProfileId", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +144,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Export Name.", SerializedName = @"exportName", PossibleTypes = new [] { typeof(string) })] @@ -146,6 +158,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", SerializedName = @"externalCloudProviderId", PossibleTypes = new [] { typeof(string) })] @@ -157,14 +172,21 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.", SerializedName = @"externalCloudProviderType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType? ExternalCloudProviderType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("externalSubscriptions", "externalBillingAccounts")] + string ExternalCloudProviderType { get; set; } /// Resource identity path [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -173,6 +195,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target operation Id.", SerializedName = @"operationId", PossibleTypes = new [] { typeof(string) })] @@ -191,6 +216,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -199,6 +227,9 @@ public partial interface ICostManagementIdentity : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"View name", SerializedName = @"viewName", PossibleTypes = new [] { typeof(string) })] @@ -225,7 +256,8 @@ public partial interface ICostManagementIdentityInternal /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for /// linked account and 'externalBillingAccounts' for consolidated account. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType? ExternalCloudProviderType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("externalSubscriptions", "externalBillingAccounts")] + string ExternalCloudProviderType { get; set; } /// Resource identity path string Id { get; set; } /// The target operation Id. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.json.cs index 95a258065b15..5ef0c0ea0aa6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/CostManagementIdentity.json.cs @@ -64,16 +64,16 @@ internal CostManagementIdentity(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_viewName = If( json?.PropertyT("viewName"), out var __jsonViewName) ? (string)__jsonViewName : (string)ViewName;} - {_alertId = If( json?.PropertyT("alertId"), out var __jsonAlertId) ? (string)__jsonAlertId : (string)AlertId;} - {_externalCloudProviderType = If( json?.PropertyT("externalCloudProviderType"), out var __jsonExternalCloudProviderType) ? (string)__jsonExternalCloudProviderType : (string)ExternalCloudProviderType;} - {_externalCloudProviderId = If( json?.PropertyT("externalCloudProviderId"), out var __jsonExternalCloudProviderId) ? (string)__jsonExternalCloudProviderId : (string)ExternalCloudProviderId;} - {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)BillingAccountId;} - {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)BillingProfileId;} - {_exportName = If( json?.PropertyT("exportName"), out var __jsonExportName) ? (string)__jsonExportName : (string)ExportName;} - {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_viewName = If( json?.PropertyT("viewName"), out var __jsonViewName) ? (string)__jsonViewName : (string)_viewName;} + {_alertId = If( json?.PropertyT("alertId"), out var __jsonAlertId) ? (string)__jsonAlertId : (string)_alertId;} + {_externalCloudProviderType = If( json?.PropertyT("externalCloudProviderType"), out var __jsonExternalCloudProviderType) ? (string)__jsonExternalCloudProviderType : (string)_externalCloudProviderType;} + {_externalCloudProviderId = If( json?.PropertyT("externalCloudProviderId"), out var __jsonExternalCloudProviderId) ? (string)__jsonExternalCloudProviderId : (string)_externalCloudProviderId;} + {_billingAccountId = If( json?.PropertyT("billingAccountId"), out var __jsonBillingAccountId) ? (string)__jsonBillingAccountId : (string)_billingAccountId;} + {_billingProfileId = If( json?.PropertyT("billingProfileId"), out var __jsonBillingProfileId) ? (string)__jsonBillingProfileId : (string)_billingProfileId;} + {_exportName = If( json?.PropertyT("exportName"), out var __jsonExportName) ? (string)__jsonExportName : (string)_exportName;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)_operationId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.PowerShell.cs similarity index 51% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.PowerShell.cs index b632c6189c0a..30e3307669c9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class Dimension partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Dimension(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Dimension(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,77 +104,77 @@ internal Dimension(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("FilterEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Total")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("UsageStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("UsageEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -181,71 +189,71 @@ internal Dimension(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("FilterEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Total")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("UsageStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("UsageEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -255,12 +263,24 @@ internal Dimension(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List of Dimension. [System.ComponentModel.TypeConverter(typeof(DimensionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.TypeConverter.cs index 1c43b81a6e14..2be495ceb558 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.cs similarity index 64% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.cs index 7d3a87b0739e..c62c73fb626e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.cs @@ -3,140 +3,139 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// List of Dimension. public partial class Dimension : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(); /// Dimension category. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Category; } + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Category; } /// Dimension data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] Data { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Data; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Data = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Data { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Data; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Data = value ?? null /* arrayOf */; } /// Dimension description. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Description; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Description; } /// ETag of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; } /// Filter enabled. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled; } + public bool? FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).FilterEnabled; } /// Grouping enabled. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled; } + public bool? GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).GroupingEnabled; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; } /// Location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; } /// Internal Acessors for Category - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Category = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Category = value; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Description = value; } /// Internal Acessors for FilterEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).FilterEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).FilterEnabled = value; } /// Internal Acessors for GroupingEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).GroupingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).GroupingEnabled = value; } /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).NextLink = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionProperties()); set { {_property = value;} } } /// Internal Acessors for Total - int? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Total; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Total = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Total; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Total = value; } /// Internal Acessors for UsageEnd - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageEnd = value; } /// Internal Acessors for UsageStart - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageStart = value; } /// Internal Acessors for ETag - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Location - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Sku - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for Tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink; } + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).NextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties _property; /// Dimension properties. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionProperties()); set => this._property = value; } /// SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; } + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; } /// Total number of data for the dimension. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public int? Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).Total; } + public int? Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).Total; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; } /// Usage end. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd; } + public global::System.DateTime? UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageEnd; } /// Usage start. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart; } + public global::System.DateTime? UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)Property).UsageStart; } /// Creates an new instance. public Dimension() @@ -159,12 +158,15 @@ public Dimension() /// List of Dimension. public partial interface IDimension : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource { /// Dimension category. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Dimension category.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -173,14 +175,20 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dimension data.", SerializedName = @"data", PossibleTypes = new [] { typeof(string) })] - string[] Data { get; set; } + System.Collections.Generic.List Data { get; set; } /// Dimension description. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Dimension description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -189,6 +197,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Filter enabled.", SerializedName = @"filterEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -197,6 +208,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Grouping enabled.", SerializedName = @"groupingEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -205,6 +219,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -213,6 +230,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Total number of data for the dimension.", SerializedName = @"total", PossibleTypes = new [] { typeof(int) })] @@ -221,6 +241,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Usage end.", SerializedName = @"usageEnd", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -229,6 +252,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Usage start.", SerializedName = @"usageStart", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -237,12 +263,12 @@ public partial interface IDimension : } /// List of Dimension. public partial interface IDimensionInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal { /// Dimension category. string Category { get; set; } /// Dimension data. - string[] Data { get; set; } + System.Collections.Generic.List Data { get; set; } /// Dimension description. string Description { get; set; } /// Filter enabled. @@ -252,7 +278,7 @@ public partial interface IDimensionInternal : /// The link (url) to the next page of results. string NextLink { get; set; } /// Dimension properties. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties Property { get; set; } /// Total number of data for the dimension. int? Total { get; set; } /// Usage end. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.json.cs index 6e59124671b3..38d3fe58ceed 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Dimension.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Dimension.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal Dimension(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Jso { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new Dimension(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.PowerShell.cs similarity index 56% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.PowerShell.cs index 019a73b2e73e..a5324ab52ecd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DimensionProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DimensionProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DimensionProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,45 +104,45 @@ internal DimensionProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("FilterEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Total")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("UsageStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("UsageEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -149,39 +157,39 @@ internal DimensionProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("FilterEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("GroupingEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Total")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("UsageStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("UsageEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).UsageEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -191,12 +199,24 @@ internal DimensionProperties(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Dimension properties. [System.ComponentModel.TypeConverter(typeof(DimensionPropertiesTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.TypeConverter.cs index 5c654e53c8f0..bfd9d2f0bd76 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.cs index a9c746f77e36..c3f0b33c8fb8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Dimension properties. public partial class DimensionProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DimensionProperties : public string Category { get => this._category; } /// Backing field for property. - private string[] _data; + private System.Collections.Generic.List _data; /// Dimension data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Data { get => this._data; set => this._data = value; } + public System.Collections.Generic.List Data { get => this._data; set => this._data = value; } /// Backing field for property. private string _description; @@ -49,28 +49,28 @@ public partial class DimensionProperties : public bool? GroupingEnabled { get => this._groupingEnabled; } /// Internal Acessors for Category - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.Category { get => this._category; set { {_category = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.Category { get => this._category; set { {_category = value;} } } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for FilterEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.FilterEnabled { get => this._filterEnabled; set { {_filterEnabled = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.FilterEnabled { get => this._filterEnabled; set { {_filterEnabled = value;} } } /// Internal Acessors for GroupingEnabled - bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.GroupingEnabled { get => this._groupingEnabled; set { {_groupingEnabled = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.GroupingEnabled { get => this._groupingEnabled; set { {_groupingEnabled = value;} } } /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Total - int? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.Total { get => this._total; set { {_total = value;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.Total { get => this._total; set { {_total = value;} } } /// Internal Acessors for UsageEnd - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } /// Internal Acessors for UsageStart - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } /// Backing field for property. private string _nextLink; @@ -114,6 +114,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Dimension category.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -122,14 +125,20 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dimension data.", SerializedName = @"data", PossibleTypes = new [] { typeof(string) })] - string[] Data { get; set; } + System.Collections.Generic.List Data { get; set; } /// Dimension description. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Dimension description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -138,6 +147,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Filter enabled.", SerializedName = @"filterEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -146,6 +158,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Grouping enabled.", SerializedName = @"groupingEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -154,6 +169,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -162,6 +180,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Total number of data for the dimension.", SerializedName = @"total", PossibleTypes = new [] { typeof(int) })] @@ -170,6 +191,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Usage end.", SerializedName = @"usageEnd", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -178,6 +202,9 @@ public partial interface IDimensionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Usage start.", SerializedName = @"usageStart", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -191,7 +218,7 @@ public partial interface IDimensionPropertiesInternal /// Dimension category. string Category { get; set; } /// Dimension data. - string[] Data { get; set; } + System.Collections.Generic.List Data { get; set; } /// Dimension description. string Description { get; set; } /// Filter enabled. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.json.cs index b02a2c157dd6..1e048e30b6f9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,26 +65,26 @@ internal DimensionProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_filterEnabled = If( json?.PropertyT("filterEnabled"), out var __jsonFilterEnabled) ? (bool?)__jsonFilterEnabled : FilterEnabled;} - {_groupingEnabled = If( json?.PropertyT("groupingEnabled"), out var __jsonGroupingEnabled) ? (bool?)__jsonGroupingEnabled : GroupingEnabled;} - {_data = If( json?.PropertyT("data"), out var __jsonData) ? If( __jsonData as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Data;} - {_total = If( json?.PropertyT("total"), out var __jsonTotal) ? (int?)__jsonTotal : Total;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_usageStart = If( json?.PropertyT("usageStart"), out var __jsonUsageStart) ? global::System.DateTime.TryParse((string)__jsonUsageStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageStartValue) ? __jsonUsageStartValue : UsageStart : UsageStart;} - {_usageEnd = If( json?.PropertyT("usageEnd"), out var __jsonUsageEnd) ? global::System.DateTime.TryParse((string)__jsonUsageEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageEndValue) ? __jsonUsageEndValue : UsageEnd : UsageEnd;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_filterEnabled = If( json?.PropertyT("filterEnabled"), out var __jsonFilterEnabled) ? (bool?)__jsonFilterEnabled : _filterEnabled;} + {_groupingEnabled = If( json?.PropertyT("groupingEnabled"), out var __jsonGroupingEnabled) ? (bool?)__jsonGroupingEnabled : _groupingEnabled;} + {_data = If( json?.PropertyT("data"), out var __jsonData) ? If( __jsonData as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _data;} + {_total = If( json?.PropertyT("total"), out var __jsonTotal) ? (int?)__jsonTotal : _total;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_usageStart = If( json?.PropertyT("usageStart"), out var __jsonUsageStart) ? global::System.DateTime.TryParse((string)__jsonUsageStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageStartValue) ? __jsonUsageStartValue : _usageStart : _usageStart;} + {_usageEnd = If( json?.PropertyT("usageEnd"), out var __jsonUsageEnd) ? global::System.DateTime.TryParse((string)__jsonUsageEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUsageEndValue) ? __jsonUsageEndValue : _usageEnd : _usageEnd;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new DimensionProperties(json) : null; } @@ -108,15 +108,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._filterEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonBoolean((bool)this._filterEnabled) : null, "filterEnabled" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._groupingEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonBoolean((bool)this._groupingEnabled) : null, "groupingEnabled" ,container.Add ); } @@ -129,23 +129,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T } container.Add("data",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._total ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNumber((int)this._total) : null, "total" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._usageStart ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._usageStart?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "usageStart" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._usageEnd ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._usageEnd?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "usageEnd" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.PowerShell.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.PowerShell.cs index 4f37be75c52d..5a45f280a9da 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DimensionsListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DimensionsListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DimensionsListResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal DimensionsListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +125,7 @@ internal DimensionsListResult(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.DimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DimensionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal DimensionsListResult(global::System.Management.Automation.PSObject cont /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of listing dimensions. It contains a list of available dimensions. [System.ComponentModel.TypeConverter(typeof(DimensionsListResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.TypeConverter.cs index d0a8aad8af0a..bbe3641d57b1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.cs index f850c631fd7e..ef2ad5f359c9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Result of listing dimensions. It contains a list of available dimensions. public partial class DimensionsListResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[] _value; + private System.Collections.Generic.List _value; /// The list of dimensions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public DimensionsListResult() @@ -37,10 +37,13 @@ public partial interface IDimensionsListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of dimensions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension) })] + System.Collections.Generic.List Value { get; } } /// Result of listing dimensions. It contains a list of available dimensions. @@ -48,7 +51,7 @@ public partial interface IDimensionsListResultInternal { /// The list of dimensions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.json.cs similarity index 90% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.json.cs index d4a08f320cf1..30f303410cc3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DimensionsListResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DimensionsListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DimensionsListResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Dimension.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Dimension.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDimensionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDimensionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new DimensionsListResult(json) : null; } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.PowerShell.cs new file mode 100644 index 000000000000..26140b7c943c --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.PowerShell.cs @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The request payload to update an alert + [System.ComponentModel.TypeConverter(typeof(DismissAlertPayloadTypeConverter))] + public partial class DismissAlertPayload + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DismissAlertPayload(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DismissAlertPayload(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DismissAlertPayload(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DismissAlertPayload(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Source, global::System.Convert.ToString); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCategory = (string) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCategory, global::System.Convert.ToString); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCriterion = (string) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DefinitionCriterion, global::System.Convert.ToString); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (string) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTimeGrainType, global::System.Convert.ToString); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailMeterFilter = (System.Collections.Generic.List) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOperator = (string) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOperator, global::System.Convert.ToString); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactEmail = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactGroup = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactRole = (System.Collections.Generic.List) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The request payload to update an alert + [System.ComponentModel.TypeConverter(typeof(DismissAlertPayloadTypeConverter))] + public partial interface IDismissAlertPayload + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.TypeConverter.cs index bb83776affc1..b4e3c6781b04 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.cs similarity index 59% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.cs index 1b93d29df000..4adc091439e9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.cs @@ -3,167 +3,167 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The request payload to update an alert public partial class DismissAlertPayload : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal { /// dateTime in which alert was closed [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } + public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } /// related budget [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } + public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } /// dateTime in which alert was created [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } + public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } /// Alert category [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory)""); } + public string DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? null; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria)""); } + public string DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? null; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DefinitionType = value ?? null; } /// Alert description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Description = value ?? null; } /// budget threshold amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } /// company name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } /// list of emails to contact [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } /// department name [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } /// datetime of enrollmentEndDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } /// enrollment number [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } /// datetime of enrollmentStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } /// invoicing threshold [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } /// array of meters to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator)""); } + public string DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOperator = value ?? null; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } /// datetime of periodStartDate [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } /// array of resources to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } /// notification threshold percentage as a decimal which activated this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } /// Type of timegrain cadence [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType)""); } + public string DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? null; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } /// unit of currency being used [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit = value ?? null; } + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).DetailUnit = value ?? null; } /// Internal Acessors for Definition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Definition = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Definition = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Detail = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Detail = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayloadInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayloadInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties()); set { {_property = value;} } } /// dateTime in which alert was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } + public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties _property; /// Alert properties. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties()); set => this._property = value; } /// Source of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Source = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource)""); } + public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Source = value ?? null; } /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).Status = value ?? null; } /// dateTime in which the alert status was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } + public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } /// User who last modified the alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } + public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } /// Creates an new instance. public DismissAlertPayload() @@ -179,6 +179,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was closed", SerializedName = @"closeTime", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +190,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"related budget", SerializedName = @"costEntityId", PossibleTypes = new [] { typeof(string) })] @@ -195,6 +201,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was created", SerializedName = @"creationTime", PossibleTypes = new [] { typeof(string) })] @@ -203,30 +212,45 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert category", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Criteria that triggered alert", SerializedName = @"criteria", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"type of alert", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Alert description", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -235,6 +259,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"budget threshold amount", SerializedName = @"amount", PossibleTypes = new [] { typeof(decimal) })] @@ -243,6 +270,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"company name", SerializedName = @"companyName", PossibleTypes = new [] { typeof(string) })] @@ -251,30 +281,42 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of emails to contact", SerializedName = @"contactEmails", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of action groups to broadcast to", SerializedName = @"contactGroups", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of contact roles", SerializedName = @"contactRoles", PossibleTypes = new [] { typeof(string) })] - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"current spend", SerializedName = @"currentSpend", PossibleTypes = new [] { typeof(decimal) })] @@ -283,6 +325,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"department name", SerializedName = @"departmentName", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +336,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentEndDate", SerializedName = @"enrollmentEndDate", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +347,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"enrollment number", SerializedName = @"enrollmentNumber", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +358,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of enrollmentStartDate", SerializedName = @"enrollmentStartDate", PossibleTypes = new [] { typeof(string) })] @@ -315,6 +369,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"invoicing threshold", SerializedName = @"invoicingThreshold", PossibleTypes = new [] { typeof(decimal) })] @@ -323,22 +380,32 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of meters to filter by", SerializedName = @"meterFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"operator used to compare currentSpend with amount", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"overriding alert", SerializedName = @"overridingAlert", PossibleTypes = new [] { typeof(string) })] @@ -347,6 +414,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"datetime of periodStartDate", SerializedName = @"periodStartDate", PossibleTypes = new [] { typeof(string) })] @@ -355,22 +425,31 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resources to filter by", SerializedName = @"resourceFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"array of resourceGroups to filter by", SerializedName = @"resourceGroupFilter", PossibleTypes = new [] { typeof(string) })] - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"tags to filter by", SerializedName = @"tagFilter", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] @@ -379,6 +458,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notification threshold percentage as a decimal which activated this alert", SerializedName = @"threshold", PossibleTypes = new [] { typeof(decimal) })] @@ -387,14 +469,21 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of timegrain cadence", SerializedName = @"timeGrainType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"notificationId that triggered this alert", SerializedName = @"triggeredBy", PossibleTypes = new [] { typeof(string) })] @@ -403,6 +492,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"unit of currency being used", SerializedName = @"unit", PossibleTypes = new [] { typeof(string) })] @@ -411,6 +503,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which alert was last modified", SerializedName = @"modificationTime", PossibleTypes = new [] { typeof(string) })] @@ -419,22 +514,33 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source of alert", SerializedName = @"source", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"alert status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"dateTime in which the alert status was last modified", SerializedName = @"statusModificationTime", PossibleTypes = new [] { typeof(string) })] @@ -443,6 +549,9 @@ public partial interface IDismissAlertPayload : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User who last modified the alert", SerializedName = @"statusModificationUserName", PossibleTypes = new [] { typeof(string) })] @@ -460,27 +569,30 @@ public partial interface IDismissAlertPayloadInternal /// dateTime in which alert was created string CreationTime { get; set; } /// defines the type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDefinition Definition { get; set; } /// Alert category - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory? DefinitionCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Cost", "Usage", "Billing", "System")] + string DefinitionCategory { get; set; } /// Criteria that triggered alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria? DefinitionCriterion { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError")] + string DefinitionCriterion { get; set; } /// type of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast")] + string DefinitionType { get; set; } /// Alert description string Description { get; set; } /// Alert details - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertPropertiesDetails Detail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertPropertiesDetails Detail { get; set; } /// budget threshold amount decimal? DetailAmount { get; set; } /// company name string DetailCompanyName { get; set; } /// list of emails to contact - string[] DetailContactEmail { get; set; } + System.Collections.Generic.List DetailContactEmail { get; set; } /// list of action groups to broadcast to - string[] DetailContactGroup { get; set; } + System.Collections.Generic.List DetailContactGroup { get; set; } /// list of contact roles - string[] DetailContactRole { get; set; } + System.Collections.Generic.List DetailContactRole { get; set; } /// current spend decimal? DetailCurrentSpend { get; set; } /// department name @@ -494,23 +606,25 @@ public partial interface IDismissAlertPayloadInternal /// invoicing threshold decimal? DetailInvoicingThreshold { get; set; } /// array of meters to filter by - string[] DetailMeterFilter { get; set; } + System.Collections.Generic.List DetailMeterFilter { get; set; } /// operator used to compare currentSpend with amount - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator? DetailOperator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo")] + string DetailOperator { get; set; } /// overriding alert string DetailOverridingAlert { get; set; } /// datetime of periodStartDate string DetailPeriodStartDate { get; set; } /// array of resources to filter by - string[] DetailResourceFilter { get; set; } + System.Collections.Generic.List DetailResourceFilter { get; set; } /// array of resourceGroups to filter by - string[] DetailResourceGroupFilter { get; set; } + System.Collections.Generic.List DetailResourceGroupFilter { get; set; } /// tags to filter by Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny DetailTagFilter { get; set; } /// notification threshold percentage as a decimal which activated this alert decimal? DetailThreshold { get; set; } /// Type of timegrain cadence - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual")] + string DetailTimeGrainType { get; set; } /// notificationId that triggered this alert string DetailTriggeredBy { get; set; } /// unit of currency being used @@ -518,11 +632,13 @@ public partial interface IDismissAlertPayloadInternal /// dateTime in which alert was last modified string ModificationTime { get; set; } /// Alert properties. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IAlertProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAlertProperties Property { get; set; } /// Source of alert - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource? Source { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Preset", "User")] + string Source { get; set; } /// alert status - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("None", "Active", "Overridden", "Resolved", "Dismissed")] + string Status { get; set; } /// dateTime in which the alert status was last modified string StatusModificationTime { get; set; } /// User who last modified the alert diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.json.cs index 42b7dc14fa38..f132723ed311 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/DismissAlertPayload.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/DismissAlertPayload.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DismissAlertPayload(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.AlertProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AlertProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IDismissAlertPayload FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IDismissAlertPayload FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new DismissAlertPayload(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs index 9803e925315d..5b9e15bd0b78 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorDetails partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetails(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetails(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ErrorDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ErrorDetails(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ErrorDetails(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The details of the error. [System.ComponentModel.TypeConverter(typeof(ErrorDetailsTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs index 88cfd5abf6bd..2c116bbf0142 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.cs similarity index 89% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.cs index 0d0f8453b1f3..4fffc47b9e4a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The details of the error. public partial class ErrorDetails : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class ErrorDetails : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorDetails() @@ -47,6 +47,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.json.cs index f840c1815edc..b31693100f06 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorDetails.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime. { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ErrorDetails(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 7395f157954f..f36d71de4981 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -63,33 +63,41 @@ public partial class ErrorResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +112,21 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,15 +141,15 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,12 +159,24 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error /// message. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 64792d488564..5bc4e2041b80 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.cs similarity index 77% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.cs index 8c5cdb771e5d..c84c4b968320 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -17,33 +17,33 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// header. /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails _error; /// The details of the error. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set => this._error = value; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message = value; } /// Creates an new instance. public ErrorResponse() @@ -65,6 +65,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +76,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -92,7 +98,7 @@ public partial interface IErrorResponseInternal /// Error code. string Code { get; set; } /// The details of the error. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.json.cs index 47faaf1a73b8..fa7b5e2ed5e5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ErrorResponse.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -73,18 +73,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.PowerShell.cs new file mode 100644 index 000000000000..4dc3aede9d46 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.PowerShell.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// An export resource. + [System.ComponentModel.TypeConverter(typeof(ExportTypeConverter))] + public partial class Export + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Export(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Export(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Export(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleStatus = (string) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleStatus, global::System.Convert.ToString); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrence = (string) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrence, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Export(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleStatus = (string) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleStatus, global::System.Convert.ToString); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrence = (string) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ScheduleRecurrence, global::System.Convert.ToString); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An export resource. + [System.ComponentModel.TypeConverter(typeof(ExportTypeConverter))] + public partial interface IExport + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.TypeConverter.cs similarity index 98% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.TypeConverter.cs index c574c04a428f..8f4cda74fc27 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.cs similarity index 62% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.cs index 1b38bf22f95e..f60d5ef77a77 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.cs @@ -3,62 +3,62 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// An export resource. public partial class Export : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(); /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DataSetGranularity = value ?? null; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); } + public string DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionTimeframe = value ?? null; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionType = value ?? null; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationContainer = value ?? null; } + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationContainer = value ?? null; } /// /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount /// are specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationResourceId = value ?? null; } + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationResourceId = value ?? null; } /// The name of the directory where exports will be uploaded. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationRootFolderPath = value ?? null; } + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationRootFolderPath = value ?? null; } /// /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be @@ -67,132 +67,136 @@ public partial class Export : /// specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationSasToken = value ?? null; } + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationSasToken = value ?? null; } /// /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken /// can be specified instead of resourceId. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationStorageAccount = value ?? null; } + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DestinationStorageAccount = value ?? null; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); } + public string Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).Format = value ?? null; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DataSetConfiguration = value; } /// Internal Acessors for Definition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).Definition = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).Definition = value; } /// Internal Acessors for DefinitionDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionDataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionDataSet = value; } /// Internal Acessors for DefinitionTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod = value; } /// Internal Acessors for DeliveryInfo - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DeliveryInfo = value; } /// Internal Acessors for DeliveryInfoDestination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination = value; } /// Internal Acessors for NextRunTimeEstimate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportProperties()); set { {_property = value;} } } /// Internal Acessors for RunHistory - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistory = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).RunHistory = value; } /// Internal Acessors for RunHistoryValue - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).RunHistoryValue = value; } /// Internal Acessors for Schedule - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.Schedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).Schedule = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.Schedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).Schedule = value; } /// Internal Acessors for ScheduleRecurrencePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate; } + public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate; } /// /// 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 modern commerce scopes. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).PartitionData = value ?? default(bool); } + public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).PartitionData = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties _property; /// The properties of the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportProperties()); set => this._property = value; } /// The start date of recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } /// The end date of recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).RecurrencePeriodTo = value ?? default(global::System.DateTime); } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// A list of export executions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue; } + public System.Collections.Generic.List RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).RunHistoryValue; } /// The schedule recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrence = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType)""); } + public string ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleRecurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleRecurrence = value ?? null; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType)""); } + public string ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)Property).ScheduleStatus = value ?? null; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; } /// Creates an new instance. public Export() @@ -215,7 +219,7 @@ public Export() /// An export resource. public partial interface IExport : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource { /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. @@ -224,28 +228,39 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. @@ -253,16 +268,23 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -274,6 +296,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +307,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -295,6 +323,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +337,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] @@ -314,16 +348,23 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string Format { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"If the export has an active schedule, provides an estimate of the next execution time.", SerializedName = @"nextRunTimeEstimate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -335,6 +376,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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 modern commerce scopes.", SerializedName = @"partitionData", PossibleTypes = new [] { typeof(bool) })] @@ -343,6 +387,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date of recurrence.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -351,6 +398,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date of recurrence.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -359,32 +409,46 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"A list of export executions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) })] + System.Collections.Generic.List RunHistoryValue { get; } /// The schedule recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The schedule recurrence.", SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string ScheduleRecurrence { get; set; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string ScheduleStatus { get; set; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -393,6 +457,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -401,36 +468,39 @@ public partial interface IExport : } /// An export resource. public partial interface IExportInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal { /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// Has the definition for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Definition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Definition { get; set; } /// The definition for data in the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DefinitionDataSet { get; set; } /// Has time period for pulling data for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DefinitionTimePeriod { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// Has delivery information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeliveryInfo { get; set; } /// Has destination for the export being delivered. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeliveryInfoDestination { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// @@ -455,7 +525,8 @@ public partial interface IExportInternal : /// string DestinationStorageAccount { get; set; } /// The format of the export being delivered. Currently only 'Csv' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? Format { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string Format { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// @@ -466,28 +537,30 @@ public partial interface IExportInternal : /// bool? PartitionData { get; set; } /// The properties of the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties Property { get; set; } /// The start date of recurrence. global::System.DateTime? RecurrencePeriodFrom { get; set; } /// The end date of recurrence. global::System.DateTime? RecurrencePeriodTo { get; set; } /// If requested, has the most recent execution history for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunHistory { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunHistory { get; set; } /// A list of export executions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + System.Collections.Generic.List RunHistoryValue { get; set; } /// Has schedule information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule Schedule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule Schedule { get; set; } /// The schedule recurrence. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? ScheduleRecurrence { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string ScheduleRecurrence { get; set; } /// /// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than /// start date. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod ScheduleRecurrencePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod ScheduleRecurrencePeriod { get; set; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? ScheduleStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string ScheduleStatus { get; set; } /// The start date for export data. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date for export data. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.json.cs index d0b233cff8c1..faeecb98aff5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Export.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Export.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal Export(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.J { return; } - __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new Export(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.PowerShell.cs similarity index 68% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.PowerShell.cs index cf2bf6bcf28a..4fa134e2fbb8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ExportDataset partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportDataset(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportDataset(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,21 +104,21 @@ internal ExportDataset(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -125,15 +133,15 @@ internal ExportDataset(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -143,12 +151,24 @@ internal ExportDataset(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The definition for data in the export. [System.ComponentModel.TypeConverter(typeof(ExportDatasetTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.TypeConverter.cs index 8c66eb38dc3d..1021c955d45d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.cs index b61091df15a1..be90dbab50a0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.cs @@ -3,39 +3,39 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition for data in the export. public partial class ExportDataset : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration _configuration; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration _configuration; /// The export dataset configuration. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfiguration()); set => this._configuration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfiguration()); set => this._configuration = value; } /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? _granularity; + private string _granularity; /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + public string Granularity { get => this._granularity; set => this._granularity = value; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfiguration()); set { {_configuration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfiguration()); set { {_configuration = value;} } } /// Creates an new instance. public ExportDataset() @@ -54,18 +54,25 @@ public partial interface IExportDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } } /// The definition for data in the export. @@ -73,14 +80,15 @@ public partial interface IExportDatasetInternal { /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Configuration { get; set; } /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.json.cs index e4e0b001766a..0e6289ed3d27 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDataset.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDataset.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExportDataset(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime { return; } - {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} - {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)Granularity;} + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfiguration.FromJson(__jsonConfiguration) : _configuration;} + {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)_granularity;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportDataset(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.PowerShell.cs similarity index 76% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.PowerShell.cs index b1ca15ed9431..21f6f01fe97e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,35 +58,41 @@ public partial class ExportDatasetConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportDatasetConfiguration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportDatasetConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -101,13 +107,13 @@ internal ExportDatasetConfiguration(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -122,7 +128,7 @@ internal ExportDatasetConfiguration(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -132,12 +138,24 @@ internal ExportDatasetConfiguration(global::System.Management.Automation.PSObjec /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include /// all available columns. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.TypeConverter.cs index 186f403fb44f..8b6ae0ca1f2b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.cs similarity index 86% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.cs index f37d10e37151..3c28c9902cb9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,19 +12,19 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// all available columns. /// public partial class ExportDatasetConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfigurationInternal { /// Backing field for property. - private string[] _column; + private System.Collections.Generic.List _column; /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Creates an new instance. public ExportDatasetConfiguration() @@ -44,10 +44,13 @@ public partial interface IExportDatasetConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include @@ -59,7 +62,7 @@ public partial interface IExportDatasetConfigurationInternal /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.json.cs index 4dec23cc7792..ac881b7ccf1c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDatasetConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ExportDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.CostManag { return; } - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _column;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportDatasetConfiguration(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.PowerShell.cs similarity index 53% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.PowerShell.cs index 254ad544b1f6..2424aac82e7c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ExportDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportDefinition(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,45 +104,45 @@ internal ExportDefinition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("DataSet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Timeframe")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Timeframe, global::System.Convert.ToString); } if (content.Contains("TimePeriodFrom")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("TimePeriodTo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("DataSetConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("DataSetGranularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetGranularity, global::System.Convert.ToString); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -149,39 +157,39 @@ internal ExportDefinition(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("DataSet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Timeframe")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).Timeframe, global::System.Convert.ToString); } if (content.Contains("TimePeriodFrom")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("TimePeriodTo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("DataSetConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("DataSetGranularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).DataSetGranularity, global::System.Convert.ToString); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -191,12 +199,24 @@ internal ExportDefinition(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The definition of an export. [System.ComponentModel.TypeConverter(typeof(ExportDefinitionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.TypeConverter.cs index 5192f1df5368..3bff97b49d57 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.cs similarity index 64% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.cs index c787487802cc..6c3508213103 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of an export. public partial class ExportDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal { /// @@ -18,61 +18,61 @@ public partial class ExportDefinition : /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset _dataSet; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset _dataSet; /// The definition for data in the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDataset()); set => this._dataSet = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDataset()); set => this._dataSet = value; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).Granularity = value ?? null; } /// Internal Acessors for DataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDataset()); set { {_dataSet = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDataset()); set { {_dataSet = value;} } } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetInternal)DataSet).Configuration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetInternal)DataSet).Configuration = value; } /// Internal Acessors for TimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriod()); set { {_timePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriod()); set { {_timePeriod = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod _timePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod _timePeriod; /// Has time period for pulling data for the export. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriod()); set => this._timePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriod()); set => this._timePeriod = value; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } /// The end date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType _timeframe; + private string _timeframe; /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + public string Timeframe { get => this._timeframe; set => this._timeframe = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType _type; + private string _type; /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public ExportDefinition() @@ -91,22 +91,32 @@ public partial interface IExportDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -115,6 +125,9 @@ public partial interface IExportDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -125,10 +138,14 @@ public partial interface IExportDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string Timeframe { get; set; } /// /// 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. @@ -136,10 +153,14 @@ public partial interface IExportDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } /// The definition of an export. @@ -150,15 +171,16 @@ public partial interface IExportDefinitionInternal /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The definition for data in the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DataSet { get; set; } /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// Has time period for pulling data for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod TimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod TimePeriod { get; set; } /// The start date for export data. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date for export data. @@ -166,12 +188,14 @@ public partial interface IExportDefinitionInternal /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string Timeframe { get; set; } /// /// 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. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.json.cs index 60fa382c67ad..d36c851ee144 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ExportDefinition(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} - {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDataset.FromJson(__jsonDataSet) : DataSet;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)Timeframe;} + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriod.FromJson(__jsonTimePeriod) : _timePeriod;} + {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDataset.FromJson(__jsonDataSet) : _dataSet;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)_timeframe;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportDefinition(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.PowerShell.cs similarity index 72% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.PowerShell.cs index f376cfafd600..a4667a14973b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -67,35 +67,41 @@ public partial class ExportDeliveryDestination partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportDeliveryDestination(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportDeliveryDestination(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,29 +116,29 @@ internal ExportDeliveryDestination(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("Container")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); } if (content.Contains("RootFolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); } if (content.Contains("SasToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); } if (content.Contains("StorageAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).StorageAccount, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -147,23 +153,23 @@ internal ExportDeliveryDestination(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("Container")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); } if (content.Contains("RootFolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); } if (content.Contains("SasToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); } if (content.Contains("StorageAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)this).StorageAccount, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -173,12 +179,24 @@ internal ExportDeliveryDestination(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure /// the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.TypeConverter.cs index 5498e7378e39..397533130c3e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.cs index 5537ebc34a75..4e2b7edecc9d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -21,8 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// ). /// public partial class ExportDeliveryDestination : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal { /// Backing field for property. @@ -99,6 +99,9 @@ public partial interface IExportDeliveryDestination : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -110,6 +113,9 @@ public partial interface IExportDeliveryDestination : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +124,9 @@ public partial interface IExportDeliveryDestination : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +140,9 @@ public partial interface IExportDeliveryDestination : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +154,9 @@ public partial interface IExportDeliveryDestination : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.json.cs index 79f016253dd9..803935fa81ea 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryDestination.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -77,22 +77,22 @@ internal ExportDeliveryDestination(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_container = If( json?.PropertyT("container"), out var __jsonContainer) ? (string)__jsonContainer : (string)Container;} - {_rootFolderPath = If( json?.PropertyT("rootFolderPath"), out var __jsonRootFolderPath) ? (string)__jsonRootFolderPath : (string)RootFolderPath;} - {_sasToken = If( json?.PropertyT("sasToken"), out var __jsonSasToken) ? (string)__jsonSasToken : (string)SasToken;} - {_storageAccount = If( json?.PropertyT("storageAccount"), out var __jsonStorageAccount) ? (string)__jsonStorageAccount : (string)StorageAccount;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_container = If( json?.PropertyT("container"), out var __jsonContainer) ? (string)__jsonContainer : (string)_container;} + {_rootFolderPath = If( json?.PropertyT("rootFolderPath"), out var __jsonRootFolderPath) ? (string)__jsonRootFolderPath : (string)_rootFolderPath;} + {_sasToken = If( json?.PropertyT("sasToken"), out var __jsonSasToken) ? (string)__jsonSasToken : (string)_sasToken;} + {_storageAccount = If( json?.PropertyT("storageAccount"), out var __jsonStorageAccount) ? (string)__jsonStorageAccount : (string)_storageAccount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportDeliveryDestination(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.PowerShell.cs similarity index 62% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.PowerShell.cs index ccd7a908e663..50a3d371c14e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ExportDeliveryInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportDeliveryInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportDeliveryInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,33 +104,33 @@ internal ExportDeliveryInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); } if (content.Contains("DestinationResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); } if (content.Contains("DestinationContainer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); } if (content.Contains("DestinationRootFolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); } if (content.Contains("DestinationSasToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); } if (content.Contains("DestinationStorageAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationStorageAccount, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,27 +145,27 @@ internal ExportDeliveryInfo(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); } if (content.Contains("DestinationResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); } if (content.Contains("DestinationContainer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); } if (content.Contains("DestinationRootFolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); } if (content.Contains("DestinationSasToken")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); } if (content.Contains("DestinationStorageAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal)this).DestinationStorageAccount, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -167,12 +175,24 @@ internal ExportDeliveryInfo(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The delivery information associated with a export. [System.ComponentModel.TypeConverter(typeof(ExportDeliveryInfoTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.TypeConverter.cs index 3b0b462e6da3..c8729389ef49 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.cs similarity index 80% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.cs index 430e6849dbe4..8c33e12d2f0b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.cs @@ -3,39 +3,39 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The delivery information associated with a export. public partial class ExportDeliveryInfo : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination _destination; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination _destination; /// Has destination for the export being delivered. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestination()); set => this._destination = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestination()); set => this._destination = value; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).Container; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).Container = value ; } + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).Container; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).Container = value ; } /// /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount /// are specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).ResourceId = value ?? null; } + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).ResourceId = value ?? null; } /// The name of the directory where exports will be uploaded. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).RootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).RootFolderPath = value ?? null; } + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).RootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).RootFolderPath = value ?? null; } /// /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be @@ -44,17 +44,17 @@ public partial class ExportDeliveryInfo : /// specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).SasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).SasToken = value ?? null; } + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).SasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).SasToken = value ?? null; } /// /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken /// can be specified instead of resourceId. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).StorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).StorageAccount = value ?? null; } + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).StorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestinationInternal)Destination).StorageAccount = value ?? null; } /// Internal Acessors for Destination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfoInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestination()); set { {_destination = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfoInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestination()); set { {_destination = value;} } } /// Creates an new instance. public ExportDeliveryInfo() @@ -72,6 +72,9 @@ public partial interface IExportDeliveryInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +86,9 @@ public partial interface IExportDeliveryInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +97,9 @@ public partial interface IExportDeliveryInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +113,9 @@ public partial interface IExportDeliveryInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +127,9 @@ public partial interface IExportDeliveryInfo : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] @@ -126,7 +141,7 @@ public partial interface IExportDeliveryInfoInternal { /// Has destination for the export being delivered. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Destination { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Destination { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.json.cs index 7f5573ca637f..3ce0d2f70661 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportDeliveryInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ExportDeliveryInfo(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Ru { return; } - {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportDeliveryDestination.FromJson(__jsonDestination) : Destination;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestination.FromJson(__jsonDestination) : _destination;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportDeliveryInfo(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.PowerShell.cs new file mode 100644 index 000000000000..9223a2471041 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.PowerShell.cs @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// An export execution. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionTypeConverter))] + public partial class ExportExecution + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportExecution(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportExecution(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportExecution(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ExecutionType = (string) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ExecutionType, global::System.Convert.ToString); + } + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingFormat = (string) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingFormat, global::System.Convert.ToString); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportExecution(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ExecutionType = (string) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ExecutionType, global::System.Convert.ToString); + } + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingFormat = (string) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingFormat, global::System.Convert.ToString); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An export execution. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionTypeConverter))] + public partial interface IExportExecution + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.TypeConverter.cs index b44d750fac82..354129e4e048 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.cs similarity index 65% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.cs index 42904a11f754..60c4e4f401de 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.cs @@ -3,26 +3,26 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// An export execution. public partial class ExportExecution : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(); /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Code; } /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. @@ -30,19 +30,19 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DataSetGranularity = value ?? null; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); } + public string DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe = value ?? null; } /// /// The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide @@ -50,14 +50,14 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionType = value ?? null; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationContainer = value ?? null; } + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationContainer = value ?? null; } /// /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount @@ -65,12 +65,12 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationResourceId = value ?? null; } + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationResourceId = value ?? null; } /// The name of the directory where exports will be uploaded. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationRootFolderPath = value ?? null; } + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationRootFolderPath = value ?? null; } /// /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be @@ -80,7 +80,7 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationSasToken = value ?? null; } + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationSasToken = value ?? null; } /// /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken @@ -88,7 +88,7 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationStorageAccount = value ?? null; } + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DestinationStorageAccount = value ?? null; } /// /// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating @@ -96,118 +96,118 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } /// The type of the export execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 0)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ExecutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ExecutionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType)""); } + public string ExecutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ExecutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ExecutionType = value ?? null; } /// The name of the exported file. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 5)] - public string FileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).FileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).FileName = value ?? null; } + public string FileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).FileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).FileName = value ?? null; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Code = value; } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DataSetConfiguration = value; } /// Internal Acessors for DefinitionDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionDataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionDataSet = value; } /// Internal Acessors for DefinitionTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod = value; } /// Internal Acessors for DeliveryInfoDestination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Error = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Error = value; } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Message = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionProperties()); set { {_property = value;} } } /// Internal Acessors for RunHistoryValue - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunHistoryValue = value; } /// Internal Acessors for RunSetting - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSetting = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSetting = value; } /// Internal Acessors for RunSettingDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingDefinition = value; } /// Internal Acessors for RunSettingDeliveryInfo - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo = value; } /// Internal Acessors for RunSettingNextRunTimeEstimate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate = value; } /// Internal Acessors for RunSettingRunHistory - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; } /// The time when the export execution finished. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 2)] - public global::System.DateTime? ProcessingEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingEndTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ProcessingEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ProcessingEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ProcessingEndTime = value ?? default(global::System.DateTime); } /// The time when export was picked up to be executed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 1)] - public global::System.DateTime? ProcessingStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingStartTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ProcessingStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ProcessingStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).ProcessingStartTime = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties _property; /// The properties of the export execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionProperties()); set => this._property = value; } /// A list of export executions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue; } + public System.Collections.Generic.List RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunHistoryValue; } /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); } + public string RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingFormat = value ?? null; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate; } + public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate; } /// /// If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. @@ -215,12 +215,12 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData = value ?? default(bool); } + public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData = value ?? default(bool); } /// The last known status of the export execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 4)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).Status = value ?? null; } /// /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions @@ -228,27 +228,27 @@ public partial class ExportExecution : /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string SubmittedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedBy = value ?? null; } + public string SubmittedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).SubmittedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).SubmittedBy = value ?? null; } /// The time when export was queued to be executed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public global::System.DateTime? SubmittedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? SubmittedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).SubmittedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).SubmittedTime = value ?? default(global::System.DateTime); } /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; } /// Creates an new instance. public ExportExecution() @@ -271,12 +271,15 @@ public ExportExecution() /// An export execution. public partial interface IExportExecution : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -288,28 +291,39 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. @@ -317,16 +331,23 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +359,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -346,6 +370,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -359,6 +386,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -370,6 +400,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] @@ -378,14 +411,21 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the export execution.", SerializedName = @"executionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("OnDemand", "Scheduled")] + string ExecutionType { get; set; } /// The name of the exported file. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the exported file.", SerializedName = @"fileName", PossibleTypes = new [] { typeof(string) })] @@ -394,6 +434,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -402,6 +445,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when the export execution finished.", SerializedName = @"processingEndTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -410,6 +456,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when export was picked up to be executed.", SerializedName = @"processingStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -418,24 +467,34 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"A list of export executions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) })] + System.Collections.Generic.List RunHistoryValue { get; } /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string RunSettingFormat { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"If the export has an active schedule, provides an estimate of the next execution time.", SerializedName = @"nextRunTimeEstimate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -447,6 +506,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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 modern commerce scopes.", SerializedName = @"partitionData", PossibleTypes = new [] { typeof(bool) })] @@ -455,10 +517,14 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last known status of the export execution.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable")] + string Status { get; set; } /// /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions /// it is 'System'. @@ -466,6 +532,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", SerializedName = @"submittedBy", PossibleTypes = new [] { typeof(string) })] @@ -474,6 +543,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when export was queued to be executed.", SerializedName = @"submittedTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -482,6 +554,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -490,6 +565,9 @@ public partial interface IExportExecution : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -498,7 +576,7 @@ public partial interface IExportExecution : } /// An export execution. public partial interface IExportExecutionInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal { /// Error code. string Code { get; set; } @@ -506,26 +584,29 @@ public partial interface IExportExecutionInternal : /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// The definition for data in the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DefinitionDataSet { get; set; } /// Has time period for pulling data for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DefinitionTimePeriod { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// Has destination for the export being delivered. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeliveryInfoDestination { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// @@ -550,9 +631,10 @@ public partial interface IExportExecutionInternal : /// string DestinationStorageAccount { get; set; } /// The details of any error. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get; set; } /// The type of the export execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("OnDemand", "Scheduled")] + string ExecutionType { get; set; } /// The name of the exported file. string FileName { get; set; } /// Error message indicating why the operation failed. @@ -562,17 +644,18 @@ public partial interface IExportExecutionInternal : /// The time when export was picked up to be executed. global::System.DateTime? ProcessingStartTime { get; set; } /// The properties of the export execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties Property { get; set; } /// A list of export executions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + System.Collections.Generic.List RunHistoryValue { get; set; } /// The export settings that were in effect for this execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties RunSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties RunSetting { get; set; } /// Has the definition for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition RunSettingDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition RunSettingDefinition { get; set; } /// Has delivery information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } /// The format of the export being delivered. Currently only 'Csv' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string RunSettingFormat { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// @@ -583,9 +666,10 @@ public partial interface IExportExecutionInternal : /// bool? RunSettingPartitionData { get; set; } /// If requested, has the most recent execution history for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunSettingRunHistory { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunSettingRunHistory { get; set; } /// The last known status of the export execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable")] + string Status { get; set; } /// /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions /// it is 'System'. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.json.cs index 4ddddf89d96f..3bc334d9df19 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecution.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecution.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExportExecution(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportExecution(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.PowerShell.cs similarity index 72% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.PowerShell.cs index 46f89088b7d8..86eed2ded639 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class ExportExecutionListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportExecutionListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportExecutionListResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal ExportExecutionListResult(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +125,7 @@ internal ExportExecutionListResult(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal ExportExecutionListResult(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of listing the execution history of an export. [System.ComponentModel.TypeConverter(typeof(ExportExecutionListResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.TypeConverter.cs index 6284e11dc67d..4dfc495a51f4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.cs index 2403aaf1b041..37043c75f9b5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Result of listing the execution history of an export. public partial class ExportExecutionListResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] _value; + private System.Collections.Generic.List _value; /// A list of export executions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ExportExecutionListResult() @@ -37,10 +37,13 @@ public partial interface IExportExecutionListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"A list of export executions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) })] + System.Collections.Generic.List Value { get; } } /// Result of listing the execution history of an export. @@ -48,7 +51,7 @@ public partial interface IExportExecutionListResultInternal { /// A list of export executions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.json.cs similarity index 90% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.json.cs index 964bf80d16cc..8b71e05bd142 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ExportExecutionListResult(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportExecution.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecution.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportExecutionListResult(json) : null; } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.PowerShell.cs new file mode 100644 index 000000000000..562947c3e645 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.PowerShell.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The properties of the export execution. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionPropertiesTypeConverter))] + public partial class ExportExecutionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportExecutionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportExecutionProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportExecutionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ExecutionType = (string) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ExecutionType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingFormat = (string) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingFormat, global::System.Convert.ToString); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportExecutionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ExecutionType = (string) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ExecutionType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).SubmittedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProcessingEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ProcessingEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingFormat = (string) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingFormat, global::System.Convert.ToString); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The properties of the export execution. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionPropertiesTypeConverter))] + public partial interface IExportExecutionProperties + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.TypeConverter.cs index 9bdd0519f939..3eb00156d338 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.cs index 469611e7abf5..d71dbe8492bf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.cs @@ -3,60 +3,60 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The properties of the export execution. public partial class ExportExecutionProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; } /// /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn = value ?? null /* arrayOf */; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity = value ?? null; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); } + public string DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe = value ?? null; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); } + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionType = value ?? null; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationContainer = value ?? null; } + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationContainer = value ?? null; } /// /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount /// are specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId = value ?? null; } + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId = value ?? null; } /// The name of the directory where exports will be uploaded. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationRootFolderPath = value ?? null; } + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationRootFolderPath = value ?? null; } /// /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be @@ -65,28 +65,28 @@ public partial class ExportExecutionProperties : /// specified. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationSasToken = value ?? null; } + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationSasToken = value ?? null; } /// /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken /// can be specified instead of resourceId. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount = value ?? null; } + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails _error; /// The details of any error. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set => this._error = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? _executionType; + private string _executionType; /// The type of the export execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get => this._executionType; set => this._executionType = value; } + public string ExecutionType { get => this._executionType; set => this._executionType = value; } /// Backing field for property. private string _fileName; @@ -97,46 +97,46 @@ public partial class ExportExecutionProperties : /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code = value; } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration = value; } /// Internal Acessors for DefinitionDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet = value; } /// Internal Acessors for DefinitionTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod = value; } /// Internal Acessors for DeliveryInfoDestination - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message = value; } /// Internal Acessors for RunHistoryValue - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue = value; } /// Internal Acessors for RunSetting - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties()); set { {_runSetting = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties()); set { {_runSetting = value;} } } /// Internal Acessors for RunSettingDefinition - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Definition = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).Definition = value; } /// Internal Acessors for RunSettingDeliveryInfo - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo = value; } /// Internal Acessors for RunSettingNextRunTimeEstimate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate = value; } /// Internal Acessors for RunSettingRunHistory - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistory = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionPropertiesInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).RunHistory = value; } /// Backing field for property. private global::System.DateTime? _processingEndTime; @@ -154,38 +154,38 @@ public partial class ExportExecutionProperties : /// A list of export executions. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; } + public System.Collections.Generic.List RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties _runSetting; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties _runSetting; /// The export settings that were in effect for this execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties()); set => this._runSetting = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties()); set => this._runSetting = value; } /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); } + public string RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).Format = value ?? null; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate; } + public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate; } /// /// 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 modern commerce scopes. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).PartitionData = value ?? default(bool); } + public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).PartitionData = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? _status; + private string _status; /// The last known status of the export execution. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private string _submittedBy; @@ -206,11 +206,11 @@ public partial class ExportExecutionProperties : /// The start date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date for export data. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo = value ?? default(global::System.DateTime); } /// Creates an new instance. public ExportExecutionProperties() @@ -226,6 +226,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -237,28 +240,39 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. @@ -266,16 +280,23 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the container where exports will be uploaded. If the container does not exist it will be created.", SerializedName = @"container", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +308,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -295,6 +319,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the directory where exports will be uploaded.", SerializedName = @"rootFolderPath", PossibleTypes = new [] { typeof(string) })] @@ -308,6 +335,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified.", SerializedName = @"sasToken", PossibleTypes = new [] { typeof(string) })] @@ -319,6 +349,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId.", SerializedName = @"storageAccount", PossibleTypes = new [] { typeof(string) })] @@ -327,14 +360,21 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the export execution.", SerializedName = @"executionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("OnDemand", "Scheduled")] + string ExecutionType { get; set; } /// The name of the exported file. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the exported file.", SerializedName = @"fileName", PossibleTypes = new [] { typeof(string) })] @@ -343,6 +383,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -351,6 +394,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when the export execution finished.", SerializedName = @"processingEndTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -359,6 +405,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when export was picked up to be executed.", SerializedName = @"processingStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -367,24 +416,34 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"A list of export executions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecution) })] + System.Collections.Generic.List RunHistoryValue { get; } /// The format of the export being delivered. Currently only 'Csv' is supported. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string RunSettingFormat { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"If the export has an active schedule, provides an estimate of the next execution time.", SerializedName = @"nextRunTimeEstimate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -396,6 +455,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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 modern commerce scopes.", SerializedName = @"partitionData", PossibleTypes = new [] { typeof(bool) })] @@ -404,10 +466,14 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last known status of the export execution.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable")] + string Status { get; set; } /// /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions /// it is 'System'. @@ -415,6 +481,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", SerializedName = @"submittedBy", PossibleTypes = new [] { typeof(string) })] @@ -423,6 +492,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time when export was queued to be executed.", SerializedName = @"submittedTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -431,6 +503,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -439,6 +514,9 @@ public partial interface IExportExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -455,26 +533,29 @@ public partial interface IExportExecutionPropertiesInternal /// Array of column names to be included in the export. If not provided then the export will include all available columns. /// The available columns can vary by customer channel (see examples). /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The export dataset configuration. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get; set; } /// The granularity of rows in the export. Currently only 'Daily' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DataSetGranularity { get; set; } /// The definition for data in the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DefinitionDataSet { get; set; } /// Has time period for pulling data for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DefinitionTimePeriod { get; set; } /// /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType? DefinitionTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string DefinitionTimeframe { get; set; } /// /// 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. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType? DefinitionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string DefinitionType { get; set; } /// Has destination for the export being delivered. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeliveryInfoDestination { get; set; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. /// @@ -499,9 +580,10 @@ public partial interface IExportExecutionPropertiesInternal /// string DestinationStorageAccount { get; set; } /// The details of any error. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get; set; } /// The type of the export execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType? ExecutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("OnDemand", "Scheduled")] + string ExecutionType { get; set; } /// The name of the exported file. string FileName { get; set; } /// Error message indicating why the operation failed. @@ -511,15 +593,16 @@ public partial interface IExportExecutionPropertiesInternal /// The time when export was picked up to be executed. global::System.DateTime? ProcessingStartTime { get; set; } /// A list of export executions. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + System.Collections.Generic.List RunHistoryValue { get; set; } /// The export settings that were in effect for this execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ICommonExportProperties RunSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties RunSetting { get; set; } /// Has the definition for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDefinition RunSettingDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition RunSettingDefinition { get; set; } /// Has delivery information for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } /// The format of the export being delivered. Currently only 'Csv' is supported. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType? RunSettingFormat { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string RunSettingFormat { get; set; } /// /// If the export has an active schedule, provides an estimate of the next execution time. /// @@ -530,9 +613,10 @@ public partial interface IExportExecutionPropertiesInternal /// bool? RunSettingPartitionData { get; set; } /// If requested, has the most recent execution history for the export. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult RunSettingRunHistory { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunSettingRunHistory { get; set; } /// The last known status of the export execution. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable")] + string Status { get; set; } /// /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions /// it is 'System'. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.json.cs index 170bfcb270c5..9f5b38e772a9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportExecutionProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,26 +65,26 @@ internal ExportExecutionProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_runSetting = If( json?.PropertyT("runSettings"), out var __jsonRunSettings) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties.FromJson(__jsonRunSettings) : RunSetting;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} - {_executionType = If( json?.PropertyT("executionType"), out var __jsonExecutionType) ? (string)__jsonExecutionType : (string)ExecutionType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_submittedBy = If( json?.PropertyT("submittedBy"), out var __jsonSubmittedBy) ? (string)__jsonSubmittedBy : (string)SubmittedBy;} - {_submittedTime = If( json?.PropertyT("submittedTime"), out var __jsonSubmittedTime) ? global::System.DateTime.TryParse((string)__jsonSubmittedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSubmittedTimeValue) ? __jsonSubmittedTimeValue : SubmittedTime : SubmittedTime;} - {_processingStartTime = If( json?.PropertyT("processingStartTime"), out var __jsonProcessingStartTime) ? global::System.DateTime.TryParse((string)__jsonProcessingStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonProcessingStartTimeValue) ? __jsonProcessingStartTimeValue : ProcessingStartTime : ProcessingStartTime;} - {_processingEndTime = If( json?.PropertyT("processingEndTime"), out var __jsonProcessingEndTime) ? global::System.DateTime.TryParse((string)__jsonProcessingEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonProcessingEndTimeValue) ? __jsonProcessingEndTimeValue : ProcessingEndTime : ProcessingEndTime;} - {_fileName = If( json?.PropertyT("fileName"), out var __jsonFileName) ? (string)__jsonFileName : (string)FileName;} + {_runSetting = If( json?.PropertyT("runSettings"), out var __jsonRunSettings) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties.FromJson(__jsonRunSettings) : _runSetting;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails.FromJson(__jsonError) : _error;} + {_executionType = If( json?.PropertyT("executionType"), out var __jsonExecutionType) ? (string)__jsonExecutionType : (string)_executionType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_submittedBy = If( json?.PropertyT("submittedBy"), out var __jsonSubmittedBy) ? (string)__jsonSubmittedBy : (string)_submittedBy;} + {_submittedTime = If( json?.PropertyT("submittedTime"), out var __jsonSubmittedTime) ? global::System.DateTime.TryParse((string)__jsonSubmittedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSubmittedTimeValue) ? __jsonSubmittedTimeValue : _submittedTime : _submittedTime;} + {_processingStartTime = If( json?.PropertyT("processingStartTime"), out var __jsonProcessingStartTime) ? global::System.DateTime.TryParse((string)__jsonProcessingStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonProcessingStartTimeValue) ? __jsonProcessingStartTimeValue : _processingStartTime : _processingStartTime;} + {_processingEndTime = If( json?.PropertyT("processingEndTime"), out var __jsonProcessingEndTime) ? global::System.DateTime.TryParse((string)__jsonProcessingEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonProcessingEndTimeValue) ? __jsonProcessingEndTimeValue : _processingEndTime : _processingEndTime;} + {_fileName = If( json?.PropertyT("fileName"), out var __jsonFileName) ? (string)__jsonFileName : (string)_fileName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportExecutionProperties(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.PowerShell.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.PowerShell.cs index ab44e27a3ce5..a113d79f9fc3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -57,33 +57,41 @@ public partial class ExportListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportListResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +106,13 @@ internal ExportListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +127,7 @@ internal ExportListResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -129,12 +137,24 @@ internal ExportListResult(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of listing exports. It contains a list of available exports in the scope provided. [System.ComponentModel.TypeConverter(typeof(ExportListResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.TypeConverter.cs index 488efd56e204..3e290ff5c837 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.cs similarity index 68% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.cs index 36069ac0c272..d030906b18ae 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -11,19 +11,19 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// Result of listing exports. It contains a list of available exports in the scope provided. /// public partial class ExportListResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[] _value; + private System.Collections.Generic.List _value; /// The list of exports. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ExportListResult() @@ -39,10 +39,13 @@ public partial interface IExportListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of exports.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport) })] + System.Collections.Generic.List Value { get; } } /// Result of listing exports. It contains a list of available exports in the scope provided. @@ -50,7 +53,7 @@ public partial interface IExportListResultInternal { /// The list of exports. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.json.cs index 7a983a2a14d7..6701eb9c3cc8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportListResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -67,18 +67,18 @@ internal ExportListResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportListResult(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.PowerShell.cs new file mode 100644 index 000000000000..2411881614f8 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.PowerShell.cs @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The properties of the export. + [System.ComponentModel.TypeConverter(typeof(ExportPropertiesTypeConverter))] + public partial class ExportProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleStatus = (string) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleStatus, global::System.Convert.ToString); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrence = (string) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrence, global::System.Convert.ToString); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType = (string) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionType, global::System.Convert.ToString); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (string) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DefinitionTimeframe, global::System.Convert.ToString); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue = (System.Collections.Generic.List) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format = (string) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).Format, global::System.Convert.ToString); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)this).NextRunTimeEstimate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleStatus = (string) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleStatus, global::System.Convert.ToString); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrence = (string) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).ScheduleRecurrence, global::System.Convert.ToString); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The properties of the export. + [System.ComponentModel.TypeConverter(typeof(ExportPropertiesTypeConverter))] + public partial interface IExportProperties + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.TypeConverter.cs index bca6aa378065..668ff6ddcb58 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.cs new file mode 100644 index 000000000000..b6c44df5a1be --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + + /// The properties of the export. + public partial class ExportProperties : + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties(); + + /// + /// Array of column names to be included in the export. If not provided then the export will include all available columns. + /// The available columns can vary by customer channel (see examples). + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The export dataset configuration. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration = value ?? null /* model class */; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity = value ?? null; } + + /// Has the definition for the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Definition = value ?? null /* model class */; } + + /// The definition for data in the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet = value ?? null /* model class */; } + + /// Has time period for pulling data for the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod = value ?? null /* model class */; } + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimeframe = value ; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType = value ; } + + /// Has delivery information for the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo = value ?? null /* model class */; } + + /// Has destination for the export being delivered. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination = value ?? null /* model class */; } + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationContainer = value ; } + + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationRootFolderPath = value ?? null; } + + /// + /// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be + /// specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning + /// this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be + /// specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationSasToken = value ?? null; } + + /// + /// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken + /// can be specified instead of resourceId. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount = value ?? null; } + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public string Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Format = value ?? null; } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration = value; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).Definition = value; } + + /// Internal Acessors for DefinitionDataSet + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet = value; } + + /// Internal Acessors for DefinitionTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod = value; } + + /// Internal Acessors for DeliveryInfo + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo = value; } + + /// Internal Acessors for DeliveryInfoDestination + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination = value; } + + /// Internal Acessors for NextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate = value; } + + /// Internal Acessors for RunHistory + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory = value; } + + /// Internal Acessors for RunHistoryValue + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue = value; } + + /// Internal Acessors for Schedule + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportSchedule()); set { {_schedule = value;} } } + + /// Internal Acessors for ScheduleRecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportPropertiesInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriod = value; } + + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate; } + + /// + /// 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 modern commerce scopes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData = value ?? default(bool); } + + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).RecurrencePeriodTo = value ?? default(global::System.DateTime); } + + /// If requested, has the most recent execution history for the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory = value ?? null /* model class */; } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public System.Collections.Generic.List RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule _schedule; + + /// Has schedule information for the export. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportSchedule()); set => this._schedule = value; } + + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] + public string ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).Recurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).Recurrence = value ?? null; } + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] + public string ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)Schedule).Status = value ?? null; } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodTo = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public ExportProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__commonExportProperties), __commonExportProperties); + await eventListener.AssertObjectIsValid(nameof(__commonExportProperties), __commonExportProperties); + } + } + /// The properties of the export. + public partial interface IExportProperties : + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportProperties + { + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The start date of recurrence.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecurrencePeriodFrom { get; set; } + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The end date of recurrence.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RecurrencePeriodTo { get; set; } + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The schedule recurrence.", + SerializedName = @"recurrence", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string ScheduleRecurrence { get; set; } + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string ScheduleStatus { get; set; } + + } + /// The properties of the export. + public partial interface IExportPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICommonExportPropertiesInternal + { + /// The start date of recurrence. + global::System.DateTime? RecurrencePeriodFrom { get; set; } + /// The end date of recurrence. + global::System.DateTime? RecurrencePeriodTo { get; set; } + /// Has schedule information for the export. + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule Schedule { get; set; } + /// The schedule recurrence. + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string ScheduleRecurrence { get; set; } + /// + /// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than + /// start date. + /// + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod ScheduleRecurrencePeriod { get; set; } + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string ScheduleStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.json.cs index bc4858db5d4b..4e1b2528bf82 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExportProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.CommonExportProperties(json); - {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportSchedule.FromJson(__jsonSchedule) : Schedule;} + __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CommonExportProperties(json); + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportSchedule.FromJson(__jsonSchedule) : _schedule;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportProperties(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.PowerShell.cs index 8328207e54e8..a5d484b4cc74 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class ExportRecurrencePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportRecurrencePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportRecurrencePeriod(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +104,17 @@ internal ExportRecurrencePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -123,11 +129,11 @@ internal ExportRecurrencePeriod(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -137,12 +143,24 @@ internal ExportRecurrencePeriod(global::System.Management.Automation.PSObject co /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The start and end date for recurrence schedule. [System.ComponentModel.TypeConverter(typeof(ExportRecurrencePeriodTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.TypeConverter.cs index 85aa4848747b..4f4036734c7d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.cs index e7ba1cae4c8e..989794e13d50 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The start and end date for recurrence schedule. public partial class ExportRecurrencePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IExportRecurrencePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date of recurrence.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -49,6 +52,9 @@ public partial interface IExportRecurrencePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date of recurrence.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.json.cs index 4e8d99a1b319..4c32fcb7f2d8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportRecurrencePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExportRecurrencePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : From : From;} - {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : To : To;} + {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : _from : _from;} + {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : _to : _to;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportRecurrencePeriod(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.PowerShell.cs similarity index 62% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.PowerShell.cs index 8a02b17fbe69..5c49e84ac249 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ExportSchedule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportSchedule(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportSchedule(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,29 +104,29 @@ internal ExportSchedule(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RecurrencePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Recurrence")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Recurrence = (string) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Recurrence, global::System.Convert.ToString); } if (content.Contains("RecurrencePeriodFrom")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("RecurrencePeriodTo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,23 +141,23 @@ internal ExportSchedule(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("RecurrencePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriodTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Recurrence")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType?) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Recurrence = (string) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).Recurrence, global::System.Convert.ToString); } if (content.Contains("RecurrencePeriodFrom")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("RecurrencePeriodTo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal)this).RecurrencePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -159,12 +167,24 @@ internal ExportSchedule(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The schedule associated with the export. [System.ComponentModel.TypeConverter(typeof(ExportScheduleTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.TypeConverter.cs index ed3468a7f718..b693461951fb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.cs index 2ef0016f1709..3702442b23c7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.cs @@ -3,52 +3,52 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The schedule associated with the export. public partial class ExportSchedule : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal { /// Internal Acessors for RecurrencePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportScheduleInternal.RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriod()); set { {_recurrencePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportScheduleInternal.RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriod()); set { {_recurrencePeriod = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? _recurrence; + private string _recurrence; /// The schedule recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? Recurrence { get => this._recurrence; set => this._recurrence = value; } + public string Recurrence { get => this._recurrence; set => this._recurrence = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod _recurrencePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod _recurrencePeriod; /// /// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than /// start date. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriod()); set => this._recurrencePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriod()); set => this._recurrencePeriod = value; } /// The start date of recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).From = value ?? default(global::System.DateTime); } + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)RecurrencePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)RecurrencePeriod).From = value ?? default(global::System.DateTime); } /// The end date of recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).To = value ?? default(global::System.DateTime); } + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)RecurrencePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriodInternal)RecurrencePeriod).To = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? _status; + private string _status; /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public ExportSchedule() @@ -64,14 +64,21 @@ public partial interface IExportSchedule : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The schedule recurrence.", SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? Recurrence { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string Recurrence { get; set; } /// The start date of recurrence. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date of recurrence.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -80,6 +87,9 @@ public partial interface IExportSchedule : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date of recurrence.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -90,10 +100,14 @@ public partial interface IExportSchedule : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string Status { get; set; } } /// The schedule associated with the export. @@ -101,12 +115,13 @@ public partial interface IExportScheduleInternal { /// The schedule recurrence. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType? Recurrence { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + string Recurrence { get; set; } /// /// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than /// start date. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportRecurrencePeriod RecurrencePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportRecurrencePeriod RecurrencePeriod { get; set; } /// The start date of recurrence. global::System.DateTime? RecurrencePeriodFrom { get; set; } /// The end date of recurrence. @@ -114,7 +129,8 @@ public partial interface IExportScheduleInternal /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.json.cs index 0e1067ce8e40..f7ad7b1f870b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportSchedule.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportSchedule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ExportSchedule(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_recurrencePeriod = If( json?.PropertyT("recurrencePeriod"), out var __jsonRecurrencePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ExportRecurrencePeriod.FromJson(__jsonRecurrencePeriod) : RecurrencePeriod;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_recurrence = If( json?.PropertyT("recurrence"), out var __jsonRecurrence) ? (string)__jsonRecurrence : (string)Recurrence;} + {_recurrencePeriod = If( json?.PropertyT("recurrencePeriod"), out var __jsonRecurrencePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ExportRecurrencePeriod.FromJson(__jsonRecurrencePeriod) : _recurrencePeriod;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_recurrence = If( json?.PropertyT("recurrence"), out var __jsonRecurrence) ? (string)__jsonRecurrence : (string)_recurrence;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportSchedule(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.PowerShell.cs similarity index 71% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.PowerShell.cs index 083127c86b41..e8f19c8270cf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,33 +58,41 @@ public partial class ExportTimePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportTimePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportTimePeriod(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -99,17 +107,17 @@ internal ExportTimePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -124,11 +132,11 @@ internal ExportTimePeriod(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -138,12 +146,24 @@ internal ExportTimePeriod(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// 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. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.TypeConverter.cs index 3cdabae9f8f5..92f374eda32a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.cs index 4625a0d9d863..8685da585b51 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// range is 3 months. /// public partial class ExportTimePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriodInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface IExportTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date for export data.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -53,6 +56,9 @@ public partial interface IExportTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date for export data.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.json.cs index 585dad11cfb4..1e8d359e1df6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ExportTimePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ExportTimePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -68,19 +68,19 @@ internal ExportTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : From : From;} - {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : To : To;} + {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : _from : _from;} + {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : _to : _to;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ExportTimePeriod(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.PowerShell.cs index 478f758d0022..de277077946a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ForecastAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastAggregation(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ForecastAggregation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ForecastAggregation(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ForecastAggregation(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The aggregation expression to be used in the forecast. [System.ComponentModel.TypeConverter(typeof(ForecastAggregationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.TypeConverter.cs index 7b797b00ab55..f52467885909 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.cs similarity index 78% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.cs index f07a80ef3b14..598561609102 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The aggregation expression to be used in the forecast. public partial class ForecastAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal { /// Backing field for property. @@ -21,14 +21,14 @@ public partial class ForecastAggregation : public string Function { get => this._function; } /// Internal Acessors for Function - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregationInternal.Function { get => this._function; set { {_function = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregationInternal.Function { get => this._function; set { {_function = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName _name; + private string _name; /// The name of the column to aggregate. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName Name { get => this._name; set => this._name = value; } + public string Name { get => this._name; set => this._name = value; } /// Creates an new instance. public ForecastAggregation() @@ -44,6 +44,9 @@ public partial interface IForecastAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of the aggregation function to use.", SerializedName = @"function", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,14 @@ public partial interface IForecastAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to aggregate.", SerializedName = @"name", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName Name { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("PreTaxCostUSD", "Cost", "CostUSD", "PreTaxCost")] + string Name { get; set; } } /// The aggregation expression to be used in the forecast. @@ -65,7 +72,8 @@ public partial interface IForecastAggregationInternal /// The name of the aggregation function to use. string Function { get; set; } /// The name of the column to aggregate. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName Name { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("PreTaxCostUSD", "Cost", "CostUSD", "PreTaxCost")] + string Name { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.json.cs index 6139b7e73534..32a59e31e551 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ForecastAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)Function;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)_function;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastAggregation(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.PowerShell.cs index 229035880781..79e64cbba9cb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ForecastColumn partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastColumn(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastColumn(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ForecastColumn(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ForecastColumn(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ForecastColumn(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Forecast column properties [System.ComponentModel.TypeConverter(typeof(ForecastColumnTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.TypeConverter.cs index 7ad970757f76..a1fe6f7b3dc1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.cs index d53af5e03e61..cc0664d40dd8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Forecast column properties public partial class ForecastColumn : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumnInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumnInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IForecastColumn : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of column.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IForecastColumn : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of column.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.json.cs index f3ad3d415c8d..44781cbfd6df 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastColumn.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastColumn.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ForecastColumn(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastColumn(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.PowerShell.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.PowerShell.cs index dc4496722ff0..077732d1f03d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class ForecastComparisonExpression partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastComparisonExpression(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastComparisonExpression(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +104,21 @@ internal ForecastComparisonExpression(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,15 +133,15 @@ internal ForecastComparisonExpression(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -145,12 +151,24 @@ internal ForecastComparisonExpression(global::System.Management.Automation.PSObj /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The comparison expression to be used in the forecast. [System.ComponentModel.TypeConverter(typeof(ForecastComparisonExpressionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.TypeConverter.cs index 7f934b16fbb8..a493cfb1d56e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.cs similarity index 84% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.cs index 5c7684416566..0bb2497153ca 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The comparison expression to be used in the forecast. public partial class ForecastComparisonExpression : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal { /// Internal Acessors for Operator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } /// Backing field for property. private string _name; @@ -31,11 +31,11 @@ public partial class ForecastComparisonExpression : public string Operator { get => this._operator; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ForecastComparisonExpression() @@ -51,6 +51,9 @@ public partial interface IForecastComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IForecastComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -67,10 +73,13 @@ public partial interface IForecastComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// The comparison expression to be used in the forecast. @@ -82,7 +91,7 @@ public partial interface IForecastComparisonExpressionInternal /// The operator to use for comparison. string Operator { get; set; } /// Array of values to use for comparison - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.json.cs index 1fa6a1bd9d9b..0759ed011688 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastComparisonExpression.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ForecastComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.CostMan { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastComparisonExpression(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.PowerShell.cs new file mode 100644 index 000000000000..39a4407269a8 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.PowerShell.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The definition of data present in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetTypeConverter))] + public partial class ForecastDataset + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastDataset(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastDataset(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastDataset(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Granularity, global::System.Convert.ToString); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterAnd = (System.Collections.Generic.List) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterOr = (System.Collections.Generic.List) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastDataset(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Granularity, global::System.Convert.ToString); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterAnd = (System.Collections.Generic.List) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterOr = (System.Collections.Generic.List) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The definition of data present in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetTypeConverter))] + public partial interface IForecastDataset + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.TypeConverter.cs index 5a6d128471b5..4716a6c769bd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.cs similarity index 62% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.cs index e59bda49a2c9..1a400a8e1f71 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.cs @@ -3,106 +3,106 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of data present in the forecast. public partial class ForecastDataset : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation _aggregation; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation _aggregation; /// /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregation()); set => this._aggregation = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregation()); set => this._aggregation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration _configuration; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration _configuration; /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfiguration()); set => this._configuration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfiguration()); set => this._configuration = value; } /// /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionName = value ?? null; } + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionName = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator; } + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionOperator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter _filter; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter _filter; /// Has filter expression to use in the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilter()); set => this._filter = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilter()); set => this._filter = value; } /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).And = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).And = value ?? null /* arrayOf */; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Or; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Or = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Or; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Or = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? _granularity; + private string _granularity; /// The granularity of rows in the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + public string Granularity { get => this._granularity; set => this._granularity = value; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfiguration()); set { {_configuration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfiguration()); set { {_configuration = value;} } } /// Internal Acessors for DimensionOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).DimensionOperator = value; } /// Internal Acessors for Filter - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilter()); set { {_filter = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilter()); set { {_filter = value;} } } /// Internal Acessors for FilterDimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Dimension = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Dimension = value; } /// Internal Acessors for FilterTag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).Tag = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).Tag = value; } /// Internal Acessors for TagOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagOperator = value; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagName = value ?? null; } + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagName = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator; } + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagOperator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } /// Creates an new instance. public ForecastDataset() @@ -121,10 +121,13 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation Aggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation Aggregation { get; set; } /// /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. @@ -132,14 +135,20 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +157,9 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -156,38 +168,54 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""AND"" expression. Must have at least 2 items.", SerializedName = @"and", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List FilterAnd { get; set; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""OR"" expression. Must have at least 2 items.", SerializedName = @"or", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List FilterOr { get; set; } /// The granularity of rows in the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the forecast.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +224,9 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -204,10 +235,13 @@ public partial interface IForecastDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } } /// The definition of data present in the forecast. @@ -218,41 +252,42 @@ public partial interface IForecastDatasetInternal /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation Aggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation Aggregation { get; set; } /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration Configuration { get; set; } /// /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// The name of the column to use in comparison. string DimensionName { get; set; } /// The operator to use for comparison. string DimensionOperator { get; set; } /// Array of values to use for comparison - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// Has filter expression to use in the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter Filter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter Filter { get; set; } /// The logical "AND" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + System.Collections.Generic.List FilterAnd { get; set; } /// Has comparison expression for a dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FilterDimension { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FilterDimension { get; set; } /// The logical "OR" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + System.Collections.Generic.List FilterOr { get; set; } /// Has comparison expression for a tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FilterTag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FilterTag { get; set; } /// The granularity of rows in the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } /// The name of the column to use in comparison. string TagName { get; set; } /// The operator to use for comparison. string TagOperator { get; set; } /// Array of values to use for comparison - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.json.cs index acd52dc79fad..17e680c0653c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDataset.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDataset.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ForecastDataset(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} - {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilter.FromJson(__jsonFilter) : Filter;} - {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)Granularity;} - {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfiguration.FromJson(__jsonConfiguration) : _configuration;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilter.FromJson(__jsonFilter) : _filter;} + {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)_granularity;} + {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregation.FromJson(__jsonAggregation) : _aggregation;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastDataset(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.PowerShell.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.PowerShell.cs index 2cc162911085..b8e2037e5d53 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,35 +58,41 @@ public partial class ForecastDatasetAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastDatasetAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastDatasetAggregation(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,7 +111,7 @@ internal ForecastDatasetAggregation(global::System.Collections.IDictionary conte } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,12 +134,24 @@ internal ForecastDatasetAggregation(global::System.Management.Automation.PSObjec /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.TypeConverter.cs index c370a48861ce..2f342a2ebe86 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.cs index 7ccb0e52fbaa..aacb411b5af3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// aggregated column. forecast can have up to 2 aggregation clauses. /// public partial class ForecastDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregationInternal { /// Creates an new instance. @@ -26,7 +26,7 @@ public ForecastDatasetAggregation() /// aggregated column. forecast can have up to 2 aggregation clauses. public partial interface IForecastDatasetAggregation : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.dictionary.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.dictionary.cs index 36860fd0f610..b1b18e36c63f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.dictionary.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; public partial class ForecastDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastAggregation value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastAggregation value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDatasetAggregation source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregation source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.json.cs index 83e703007a91..d55162a1086f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -69,18 +69,18 @@ internal ForecastDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostManag { return; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastAggregation.FromJson(j) ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastAggregation.FromJson(j) ,exclusions ); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastDatasetAggregation(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.PowerShell.cs similarity index 75% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.PowerShell.cs index ab13d5d6f769..54c479a5e2e2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class ForecastDatasetConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastDatasetConfiguration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastDatasetConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal ForecastDatasetConfiguration(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +125,7 @@ internal ForecastDatasetConfiguration(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal ForecastDatasetConfiguration(global::System.Management.Automation.PSObj /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration of dataset in the forecast. [System.ComponentModel.TypeConverter(typeof(ForecastDatasetConfigurationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.TypeConverter.cs index b3d6c8c8c1f1..d943a1c6f607 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.cs similarity index 84% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.cs index bcfe9bd07e2d..d47357116212 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The configuration of dataset in the forecast. public partial class ForecastDatasetConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfigurationInternal { /// Backing field for property. - private string[] _column; + private System.Collections.Generic.List _column; /// /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Creates an new instance. public ForecastDatasetConfiguration() @@ -40,10 +40,13 @@ public partial interface IForecastDatasetConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } /// The configuration of dataset in the forecast. @@ -54,7 +57,7 @@ public partial interface IForecastDatasetConfigurationInternal /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. /// - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.json.cs index 42553217bc42..697134a91747 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDatasetConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ForecastDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.CostMan { return; } - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _column;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastDatasetConfiguration(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.PowerShell.cs new file mode 100644 index 000000000000..6e5762ded622 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.PowerShell.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The definition of a forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDefinitionTypeConverter))] + public partial class ForecastDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastDefinition(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeActualCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeFreshPartialCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatasetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetGranularity = (string) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterAnd = (System.Collections.Generic.List) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterOr = (System.Collections.Generic.List) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeActualCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeFreshPartialCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatasetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetGranularity = (string) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterAnd = (System.Collections.Generic.List) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterOr = (System.Collections.Generic.List) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The definition of a forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDefinitionTypeConverter))] + public partial interface IForecastDefinition + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.TypeConverter.cs index 959db93b90b5..df98742cc97e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.cs similarity index 65% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.cs index 6e5a8b90925e..62c32cc86faf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of a forecast. public partial class ForecastDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal { /// @@ -18,45 +18,45 @@ public partial class ForecastDefinition : /// forecast includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset _dataset; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset _dataset; /// Has definition for data in this forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDataset()); set => this._dataset = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDataset()); set => this._dataset = value; } /// /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Aggregation = value ; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Aggregation = value ; } /// The granularity of rows in the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Granularity = value ?? null; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionName = value ?? null; } + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionName = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator; } + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionOperator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionValue = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionValue = value ?? null /* arrayOf */; } /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterAnd = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterAnd = value ?? null /* arrayOf */; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterOr; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterOr = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterOr; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterOr = value ?? null /* arrayOf */; } /// Backing field for property. private bool? _includeActualCost; @@ -73,58 +73,58 @@ public partial class ForecastDefinition : public bool? IncludeFreshPartialCost { get => this._includeFreshPartialCost; set => this._includeFreshPartialCost = value; } /// Internal Acessors for Dataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDataset()); set { {_dataset = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDataset()); set { {_dataset = value;} } } /// Internal Acessors for DatasetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Configuration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Configuration = value; } /// Internal Acessors for DatasetFilter - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).Filter = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).Filter = value; } /// Internal Acessors for DimensionOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).DimensionOperator = value; } /// Internal Acessors for FilterDimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterDimension = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterDimension = value; } /// Internal Acessors for FilterTag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterTag = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).FilterTag = value; } /// Internal Acessors for TagOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagOperator = value; } /// Internal Acessors for TimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriod()); set { {_timePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriod()); set { {_timePeriod = value;} } } /// Internal Acessors for Timeframe - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinitionInternal.Timeframe { get => this._timeframe; set { {_timeframe = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinitionInternal.Timeframe { get => this._timeframe; set { {_timeframe = value;} } } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagName = value ?? null; } + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagName = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator; } + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagOperator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetInternal)Dataset).TagValue = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetInternal)Dataset).TagValue = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod _timePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod _timePeriod; /// Has time period for pulling data for the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriod()); set => this._timePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriod()); set => this._timePeriod = value; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } /// The end date to pull data to. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } /// Backing field for property. private string _timeframe= @"Custom"; @@ -136,11 +136,11 @@ public partial class ForecastDefinition : public string Timeframe { get => this._timeframe; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType _type; + private string _type; /// The type of the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public ForecastDefinition() @@ -159,10 +159,13 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. @@ -170,22 +173,32 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation DatasetAggregation { get; set; } /// The granularity of rows in the forecast. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the forecast.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DatasetGranularity { get; set; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +207,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -202,30 +218,42 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""AND"" expression. Must have at least 2 items.", SerializedName = @"and", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List FilterAnd { get; set; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""OR"" expression. Must have at least 2 items.", SerializedName = @"or", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List FilterOr { get; set; } /// A boolean determining if actualCost will be included. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A boolean determining if actualCost will be included.", SerializedName = @"includeActualCost", PossibleTypes = new [] { typeof(bool) })] @@ -234,6 +262,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A boolean determining if FreshPartialCost will be included.", SerializedName = @"includeFreshPartialCost", PossibleTypes = new [] { typeof(bool) })] @@ -242,6 +273,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -250,6 +284,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -258,14 +295,20 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -274,6 +317,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -284,6 +330,9 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", PossibleTypes = new [] { typeof(string) })] @@ -292,10 +341,14 @@ public partial interface IForecastDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the forecast.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } /// The definition of a forecast. @@ -306,37 +359,38 @@ public partial interface IForecastDefinitionInternal /// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then /// forecast includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Has definition for data in this forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDataset Dataset { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDataset Dataset { get; set; } /// /// Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the /// aggregated column. forecast can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetAggregation DatasetAggregation { get; set; } /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDatasetConfiguration DatasetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDatasetConfiguration DatasetConfiguration { get; set; } /// Has filter expression to use in the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter DatasetFilter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter DatasetFilter { get; set; } /// The granularity of rows in the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DatasetGranularity { get; set; } /// The name of the column to use in comparison. string DimensionName { get; set; } /// The operator to use for comparison. string DimensionOperator { get; set; } /// Array of values to use for comparison - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// The logical "AND" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + System.Collections.Generic.List FilterAnd { get; set; } /// Has comparison expression for a dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FilterDimension { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FilterDimension { get; set; } /// The logical "OR" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + System.Collections.Generic.List FilterOr { get; set; } /// Has comparison expression for a tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression FilterTag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression FilterTag { get; set; } /// A boolean determining if actualCost will be included. bool? IncludeActualCost { get; set; } /// A boolean determining if FreshPartialCost will be included. @@ -346,9 +400,9 @@ public partial interface IForecastDefinitionInternal /// The operator to use for comparison. string TagOperator { get; set; } /// Array of values to use for comparison - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } /// Has time period for pulling data for the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod TimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod TimePeriod { get; set; } /// The start date to pull data from. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date to pull data to. @@ -358,7 +412,8 @@ public partial interface IForecastDefinitionInternal /// string Timeframe { get; set; } /// The type of the forecast. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.json.cs index 9662d367a794..9b1b0b5ff1b4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,23 +65,23 @@ internal ForecastDefinition(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Ru { return; } - {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} - {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastDataset.FromJson(__jsonDataset) : Dataset;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)Timeframe;} - {_includeActualCost = If( json?.PropertyT("includeActualCost"), out var __jsonIncludeActualCost) ? (bool?)__jsonIncludeActualCost : IncludeActualCost;} - {_includeFreshPartialCost = If( json?.PropertyT("includeFreshPartialCost"), out var __jsonIncludeFreshPartialCost) ? (bool?)__jsonIncludeFreshPartialCost : IncludeFreshPartialCost;} + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastTimePeriod.FromJson(__jsonTimePeriod) : _timePeriod;} + {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastDataset.FromJson(__jsonDataset) : _dataset;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)_timeframe;} + {_includeActualCost = If( json?.PropertyT("includeActualCost"), out var __jsonIncludeActualCost) ? (bool?)__jsonIncludeActualCost : _includeActualCost;} + {_includeFreshPartialCost = If( json?.PropertyT("includeFreshPartialCost"), out var __jsonIncludeFreshPartialCost) ? (bool?)__jsonIncludeFreshPartialCost : _includeFreshPartialCost;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastDefinition(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.PowerShell.cs similarity index 53% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.PowerShell.cs index 3a663acdc75e..72f56560ed47 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ForecastFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastFilter(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,49 +104,49 @@ internal ForecastFilter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); } if (content.Contains("DimensionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); } if (content.Contains("DimensionOperator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); } if (content.Contains("DimensionValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TagName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); } if (content.Contains("TagOperator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); } if (content.Contains("TagValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -153,43 +161,43 @@ internal ForecastFilter(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilterTypeConverter.ConvertFrom)); } if (content.Contains("DimensionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); } if (content.Contains("DimensionOperator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); } if (content.Contains("DimensionValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionValue = (System.Collections.Generic.List) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TagName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); } if (content.Contains("TagOperator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); } if (content.Contains("TagValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal)this).TagValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagValue = (System.Collections.Generic.List) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal)this).TagValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -199,12 +207,24 @@ internal ForecastFilter(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The filter expression to be used in the export. [System.ComponentModel.TypeConverter(typeof(ForecastFilterTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.TypeConverter.cs index f4117623b961..781f20316c50 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.cs similarity index 62% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.cs index 4dabe6a4e4e4..a7d8a65ab58e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.cs @@ -3,79 +3,79 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The filter expression to be used in the export. public partial class ForecastFilter : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] _and; + private System.Collections.Generic.List _and; /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] And { get => this._and; set => this._and = value; } + public System.Collections.Generic.List And { get => this._and; set => this._and = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression _dimension; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression _dimension; /// Has comparison expression for a dimension [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression()); set => this._dimension = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression()); set => this._dimension = value; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Name = value ?? null; } + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Name = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator; } + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Operator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } /// Internal Acessors for Dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression()); set { {_dimension = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression()); set { {_dimension = value;} } } /// Internal Acessors for DimensionOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Dimension).Operator = value; } /// Internal Acessors for Tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression()); set { {_tag = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression()); set { {_tag = value;} } } /// Internal Acessors for TagOperator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilterInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilterInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Operator = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] _or; + private System.Collections.Generic.List _or; /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] Or { get => this._or; set => this._or = value; } + public System.Collections.Generic.List Or { get => this._or; set => this._or = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression _tag; /// Has comparison expression for a tag [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression()); set => this._tag = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression()); set => this._tag = value; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Name = value ?? null; } + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Name = value ?? null; } /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator; } + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Operator; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } /// Creates an new instance. public ForecastFilter() @@ -91,14 +91,20 @@ public partial interface IForecastFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""AND"" expression. Must have at least 2 items.", SerializedName = @"and", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] And { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List And { get; set; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +113,9 @@ public partial interface IForecastFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -115,22 +124,31 @@ public partial interface IForecastFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""OR"" expression. Must have at least 2 items.", SerializedName = @"or", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] Or { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) })] + System.Collections.Generic.List Or { get; set; } /// The name of the column to use in comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +157,9 @@ public partial interface IForecastFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -147,10 +168,13 @@ public partial interface IForecastFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } } /// The filter expression to be used in the export. @@ -158,25 +182,25 @@ public partial interface IForecastFilterInternal { /// The logical "AND" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] And { get; set; } + System.Collections.Generic.List And { get; set; } /// Has comparison expression for a dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Dimension { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Dimension { get; set; } /// The name of the column to use in comparison. string DimensionName { get; set; } /// The operator to use for comparison. string DimensionOperator { get; set; } /// Array of values to use for comparison - string[] DimensionValue { get; set; } + System.Collections.Generic.List DimensionValue { get; set; } /// The logical "OR" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter[] Or { get; set; } + System.Collections.Generic.List Or { get; set; } /// Has comparison expression for a tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastComparisonExpression Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastComparisonExpression Tag { get; set; } /// The name of the column to use in comparison. string TagName { get; set; } /// The operator to use for comparison. string TagOperator { get; set; } /// Array of values to use for comparison - string[] TagValue { get; set; } + System.Collections.Generic.List TagValue { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.json.cs similarity index 86% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.json.cs index 36a7e55f6c2c..172d9dce18ab 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastFilter.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ForecastFilter(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression.FromJson(__jsonDimensions) : Dimension;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastComparisonExpression.FromJson(__jsonTags) : Tag;} - {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilter.FromJson(__u) )) ))() : null : And;} - {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastFilter.FromJson(__p) )) ))() : null : Or;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression.FromJson(__jsonDimensions) : _dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastComparisonExpression.FromJson(__jsonTags) : _tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilter.FromJson(__u) )) ))() : null : _and;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastFilter.FromJson(__p) )) ))() : null : _or;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastFilter(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.PowerShell.cs similarity index 63% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.PowerShell.cs index c2c4e98c08e1..82a271f61473 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ForecastProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,21 +104,21 @@ internal ForecastProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -125,15 +133,15 @@ internal ForecastProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); } AfterDeserializePSObject(content); } @@ -143,12 +151,24 @@ internal ForecastProperties(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Forecast properties [System.ComponentModel.TypeConverter(typeof(ForecastPropertiesTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.TypeConverter.cs index 68593eae6175..93e475313eaf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.cs similarity index 68% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.cs index 7a1d05718d30..2e0654f640e1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Forecast properties public partial class ForecastProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] _column; + private System.Collections.Generic.List _column; /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Backing field for property. private string _nextLink; @@ -28,11 +28,11 @@ public partial class ForecastProperties : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] _row; + private System.Collections.Generic.List> _row; /// Array of rows [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get => this._row; set => this._row = value; } + public System.Collections.Generic.List> Row { get => this._row; set => this._row = value; } /// Creates an new instance. public ForecastProperties() @@ -48,14 +48,20 @@ public partial interface IForecastProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of columns", SerializedName = @"columns", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn) })] + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -64,10 +70,13 @@ public partial interface IForecastProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of rows", SerializedName = @"rows", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } /// Forecast properties @@ -75,11 +84,11 @@ public partial interface IForecastPropertiesInternal { /// Array of columns - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. string NextLink { get; set; } /// Array of rows - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.json.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.json.cs index 9e19d83daa58..ea7fcb62e423 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ForecastProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Ru { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumn.FromJson(__u) )) ))() : null : Column;} - {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__p, (__o)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[]) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __n) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__n, (__m)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Any.FromJson(__m) )) ))() : null /* arrayOf */)) ))() : null : Row;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumn.FromJson(__u) )) ))() : null : _column;} + {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __p) ? new global::System.Func>>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__p, (__o)=>(System.Collections.Generic.List) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __n) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__n, (__m)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Any.FromJson(__m) )) ))() : null /* arrayOf */)) ))() : null : _row;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastProperties(json) : null; } @@ -117,7 +117,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T var __r = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(); foreach( var __s in this._row ) { - AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__s, (__q) => __q?.ToJson(null, serializationMode)))) : null ,__r.Add); + AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(__s, (__q) => __q?.ToJson(null, serializationMode)))) : null ,__r.Add); } container.Add("rows",__r); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.PowerShell.cs similarity index 54% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.PowerShell.cs index f0b7d3ad1b63..f50ec5a7cfa8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -57,33 +57,41 @@ public partial class ForecastResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,53 +106,53 @@ internal ForecastResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -159,47 +167,47 @@ internal ForecastResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.AnyTypeConverter.ConvertFrom))); } AfterDeserializePSObject(content); } @@ -209,12 +217,24 @@ internal ForecastResult(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of forecast. It contains all columns listed under groupings and aggregation. [System.ComponentModel.TypeConverter(typeof(ForecastResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.TypeConverter.cs index f9199df6bb52..dec1541ef561 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.cs similarity index 57% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.cs index a9e8715640bf..deac34472d9b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -11,86 +11,89 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// Result of forecast. It contains all columns listed under groupings and aggregation. /// public partial class ForecastResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(); /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } /// ETag of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; } /// Location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastProperties()); set { {_property = value;} } } /// Internal Acessors for ETag - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Location - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Sku - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for Tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).NextLink = value ?? null; } + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).NextLink = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties _property; /// Forecast properties [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Array of rows [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } + public System.Collections.Generic.List> Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } /// SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; } + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ForecastResult() @@ -113,20 +116,26 @@ public ForecastResult() /// Result of forecast. It contains all columns listed under groupings and aggregation. public partial interface IForecastResult : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource { /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of columns", SerializedName = @"columns", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastColumn) })] + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -135,24 +144,27 @@ public partial interface IForecastResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of rows", SerializedName = @"rows", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } /// Result of forecast. It contains all columns listed under groupings and aggregation. public partial interface IForecastResultInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal { /// Array of columns - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastColumn[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. string NextLink { get; set; } /// Forecast properties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastProperties Property { get; set; } /// Array of rows - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IAny[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.json.cs index 9972b506691a..d24542b4b9cc 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ForecastResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ForecastProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ForecastProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastResult(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.PowerShell.cs index 42c6bc8cf139..8d06783902cb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ForecastTimePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ForecastTimePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ForecastTimePeriod(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ForecastTimePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ForecastTimePeriod(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ForecastTimePeriod(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Has time period for pulling data for the forecast. [System.ComponentModel.TypeConverter(typeof(ForecastTimePeriodTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.TypeConverter.cs index 11aca7c7ba9e..31e5fab8f945 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.cs index 3b2de94f0893..b05bb79e42b8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Has time period for pulling data for the forecast. public partial class ForecastTimePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriodInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IForecastTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -49,6 +52,9 @@ public partial interface IForecastTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.json.cs index d3e3adaa9902..0eefc50d7dda 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ForecastTimePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ForecastTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Ru { return; } - {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : From : From;} - {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : To : To;} + {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : _from : _from;} + {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : _to : _to;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IForecastTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IForecastTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ForecastTimePeriod(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.PowerShell.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.PowerShell.cs index c763687be4aa..85f39166caa1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -68,29 +68,37 @@ public partial class GenerateCostDetailsReportErrorResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GenerateCostDetailsReportErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GenerateCostDetailsReportErrorResponse(content); } @@ -103,10 +111,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202205 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -121,21 +129,21 @@ internal GenerateCostDetailsReportErrorResponse(global::System.Collections.IDict // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,15 +158,15 @@ internal GenerateCostDetailsReportErrorResponse(global::System.Management.Automa // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -167,6 +175,18 @@ internal GenerateCostDetailsReportErrorResponse(global::System.Management.Automa /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error /// message. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.TypeConverter.cs index 5b827b34a09c..ef57c2657eb8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.cs index a626545f509f..f64b0919da01 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -22,33 +22,33 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 /// header. /// public partial class GenerateCostDetailsReportErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails _error; /// The details of the error. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set => this._error = value; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Code = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetailsInternal)Error).Message = value; } /// Creates an new instance. public GenerateCostDetailsReportErrorResponse() @@ -75,6 +75,9 @@ public partial interface IGenerateCostDetailsReportErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +86,9 @@ public partial interface IGenerateCostDetailsReportErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -107,7 +113,7 @@ public partial interface IGenerateCostDetailsReportErrorResponseInternal /// Error code. string Code { get; set; } /// The details of the error. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorDetails Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.json.cs index cf3cf6a529e1..5730cc5cf4b3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -67,13 +67,13 @@ public partial class GenerateCostDetailsReportErrorResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new GenerateCostDetailsReportErrorResponse(json) : null; } @@ -90,7 +90,7 @@ internal GenerateCostDetailsReportErrorResponse(Microsoft.Azure.PowerShell.Cmdle { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ErrorDetails.FromJson(__jsonError) : _error;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.PowerShell.cs similarity index 61% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.PowerShell.cs index 46fc2ec550b5..1f902afd9925 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class GenerateCostDetailsReportRequestDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GenerateCostDetailsReportRequestDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GenerateCostDetailsReportRequestDefinition(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202205 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,33 +116,33 @@ internal GenerateCostDetailsReportRequestDefinition(global::System.Collections.I // actually deserialize if (content.Contains("TimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, global::System.Convert.ToString); } if (content.Contains("BillingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); } if (content.Contains("InvoiceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); } if (content.Contains("TimePeriodStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); } if (content.Contains("TimePeriodEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -149,27 +157,27 @@ internal GenerateCostDetailsReportRequestDefinition(global::System.Management.Au // actually deserialize if (content.Contains("TimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, global::System.Convert.ToString); } if (content.Contains("BillingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); } if (content.Contains("InvoiceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); } if (content.Contains("TimePeriodStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); } if (content.Contains("TimePeriodEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -178,6 +186,18 @@ internal GenerateCostDetailsReportRequestDefinition(global::System.Management.Au /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The definition of a cost detailed report. [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportRequestDefinitionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs index 55cee17535f1..bde4d4b996d7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.cs index 4d4ef71796c4..0f37c3befdf2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of a cost detailed report. public partial class GenerateCostDetailsReportRequestDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal { /// Backing field for property. @@ -37,17 +37,17 @@ public partial class GenerateCostDetailsReportRequestDefinition : public string InvoiceId { get => this._invoiceId; set => this._invoiceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? _metric; + private string _metric; /// The type of the detailed report. By default ActualCost is provided [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? Metric { get => this._metric; set => this._metric = value; } + public string Metric { get => this._metric; set => this._metric = value; } /// Internal Acessors for TimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriod()); set { {_timePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriod()); set { {_timePeriod = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod _timePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod _timePeriod; /// /// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId @@ -56,15 +56,15 @@ public partial class GenerateCostDetailsReportRequestDefinition : /// 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriod()); set => this._timePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriod()); set => this._timePeriod = value; } /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).End = value ?? null; } + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)TimePeriod).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)TimePeriod).End = value ?? null; } /// The start date to pull data from. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).Start = value ?? null; } + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)TimePeriod).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriodInternal)TimePeriod).Start = value ?? null; } /// /// Creates an new instance. @@ -86,6 +86,9 @@ public partial interface IGenerateCostDetailsReportRequestDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"billingPeriod", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +102,9 @@ public partial interface IGenerateCostDetailsReportRequestDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"invoiceId", PossibleTypes = new [] { typeof(string) })] @@ -107,14 +113,21 @@ public partial interface IGenerateCostDetailsReportRequestDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the detailed report. By default ActualCost is provided", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? Metric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string Metric { get; set; } /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to. example format 2020-03-15", SerializedName = @"end", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +136,9 @@ public partial interface IGenerateCostDetailsReportRequestDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from. example format 2020-03-15", SerializedName = @"start", PossibleTypes = new [] { typeof(string) })] @@ -147,14 +163,15 @@ public partial interface IGenerateCostDetailsReportRequestDefinitionInternal /// string InvoiceId { get; set; } /// The type of the detailed report. By default ActualCost is provided - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? Metric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string Metric { get; set; } /// /// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId /// or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body /// the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than /// 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod TimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod TimePeriod { get; set; } /// The end date to pull data to. example format 2020-03-15 string TimePeriodEnd { get; set; } /// The start date to pull data from. example format 2020-03-15 diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.json.cs index 3f24a82aefaf..d00ecbf777f5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/GenerateCostDetailsReportRequestDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class GenerateCostDetailsReportRequestDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new GenerateCostDetailsReportRequestDefinition(json) : null; } @@ -77,10 +77,10 @@ internal GenerateCostDetailsReportRequestDefinition(Microsoft.Azure.PowerShell.C { return; } - {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} - {_metric = If( json?.PropertyT("metric"), out var __jsonMetric) ? (string)__jsonMetric : (string)Metric;} - {_billingPeriod = If( json?.PropertyT("billingPeriod"), out var __jsonBillingPeriod) ? (string)__jsonBillingPeriod : (string)BillingPeriod;} - {_invoiceId = If( json?.PropertyT("invoiceId"), out var __jsonInvoiceId) ? (string)__jsonInvoiceId : (string)InvoiceId;} + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriod.FromJson(__jsonTimePeriod) : _timePeriod;} + {_metric = If( json?.PropertyT("metric"), out var __jsonMetric) ? (string)__jsonMetric : (string)_metric;} + {_billingPeriod = If( json?.PropertyT("billingPeriod"), out var __jsonBillingPeriod) ? (string)__jsonBillingPeriod : (string)_billingPeriod;} + {_invoiceId = If( json?.PropertyT("invoiceId"), out var __jsonInvoiceId) ? (string)__jsonInvoiceId : (string)_invoiceId;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.PowerShell.cs similarity index 72% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.PowerShell.cs index 3ed4a61b3a41..dfff3becaa6d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class KpiProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KpiProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KpiProperties(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal KpiProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,15 +140,15 @@ internal KpiProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal KpiProperties(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Each KPI must contain a 'type' and 'enabled' key. [System.ComponentModel.TypeConverter(typeof(KpiPropertiesTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.TypeConverter.cs index cbaa900cf0c2..40b2bf89ca34 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.cs index f61a00ae203e..47abbebae1de 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Each KPI must contain a 'type' and 'enabled' key. public partial class KpiProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiPropertiesInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class KpiProperties : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType? _type; + private string _type; /// KPI type (Forecast, Budget). [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public KpiProperties() @@ -48,6 +48,9 @@ public partial interface IKpiProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"show the KPI in the UI?", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -56,6 +59,9 @@ public partial interface IKpiProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ID of resource related to metric (budget).", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,10 +70,14 @@ public partial interface IKpiProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"KPI type (Forecast, Budget).", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Forecast", "Budget")] + string Type { get; set; } } /// Each KPI must contain a 'type' and 'enabled' key. @@ -79,7 +89,8 @@ public partial interface IKpiPropertiesInternal /// ID of resource related to metric (budget). string Id { get; set; } /// KPI type (Forecast, Budget). - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Forecast", "Budget")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.json.cs index 46f607d4feaf..890503c9c9b0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/KpiProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/KpiProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KpiProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new KpiProperties(json) : null; } @@ -77,9 +77,9 @@ internal KpiProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 63% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.PowerShell.cs index 4df517a4a42b..1a89de7db527 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Operation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,37 +111,37 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,31 +156,31 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal Operation(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A Cost management REST API operation. [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.TypeConverter.cs index d9a496a87e1b..616ccaacca59 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.cs index 143aba1a248c..ee528e339df0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.cs @@ -3,38 +3,38 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// A Cost management REST API operation. public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay _display; /// The object that represents the operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplay()); set => this._display = value; } /// Operation description [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Description; } /// Operation type: Read, write, delete, etc. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Operation; } /// Service provider: Microsoft.CostManagement. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Provider; } /// Resource on which the operation is performed: Dimensions, Query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Resource; } /// Backing field for property. private string _id; @@ -44,25 +44,25 @@ public partial class Operation : public string Id { get => this._id; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplay()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Description = value; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Operation = value; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Provider = value; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)Display).Resource = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } /// Backing field for property. private string _name; @@ -85,6 +85,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation description", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +96,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation type: Read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +107,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service provider: Microsoft.CostManagement.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource on which the operation is performed: Dimensions, Query.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +129,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation id: {provider}/{resource}/{operation}.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +140,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation name: {provider}/{resource}/{operation}.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -136,7 +154,7 @@ public partial interface IOperationInternal { /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay Display { get; set; } /// Operation description string DisplayDescription { get; set; } /// Operation type: Read, write, delete, etc. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.json.cs index db558cb13bca..7ebdcf11fa3c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Operation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,9 +77,9 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Jso { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T return container; } AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 02fb3bc14e32..21b3d36f2c1f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationDisplay partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The object that represents the operation. [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 1ccb4e240567..6b2a5042f5c7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.cs similarity index 87% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.cs index 99fb7031b46b..178f4fac15e5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The object that represents the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class OperationDisplay : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } /// Backing field for property. private string _operation; @@ -67,6 +67,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation description", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Operation type: Read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service provider: Microsoft.CostManagement.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource on which the operation is performed: Dimensions, Query.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.json.cs index ad5db1bafbc4..df719deb3521 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationDisplay.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index 87597a2be537..d56aff94972b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class OperationListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +113,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +138,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results. [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index b55e3e02715e..16983d4a5991 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.cs similarity index 76% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.cs index 42fd320a2913..d423a7380d99 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -11,15 +11,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results. /// public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -29,13 +29,13 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[] _value; + private System.Collections.Generic.List _value; /// /// List of cost management operations supported by the Microsoft.CostManagement resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public OperationListResult() @@ -51,6 +51,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next set of operation list results if there are any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -61,10 +64,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of cost management operations supported by the Microsoft.CostManagement resource provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation) })] + System.Collections.Generic.List Value { get; } } /// Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results. @@ -76,7 +82,7 @@ public partial interface IOperationListResultInternal /// /// List of cost management operations supported by the Microsoft.CostManagement resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.json.cs index 4a724ee73cb2..d1a8948aebaf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationListResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -79,8 +79,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Operation.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -103,7 +103,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -115,7 +115,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.PowerShell.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.PowerShell.cs index 68febd6d0eea..bbc0e7d6ca58 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationStatus partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationStatus(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationStatus(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal OperationStatus(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrlTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrlTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ReportUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ReportUrl = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ReportUrl, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ReportUrl = (string) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ReportUrl, global::System.Convert.ToString); } if (content.Contains("ValidUntil")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OperationStatus(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrlTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrlTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ReportUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ReportUrl = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ReportUrl, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ReportUrl = (string) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ReportUrl, global::System.Convert.ToString); } if (content.Contains("ValidUntil")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OperationStatus(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The status of the long running operation. [System.ComponentModel.TypeConverter(typeof(OperationStatusTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.TypeConverter.cs index 93ba2b969f40..a1d18bc5bdbf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.cs similarity index 63% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.cs index aa782101946e..4fad7830851b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.cs @@ -3,42 +3,42 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The status of the long running operation. public partial class OperationStatus : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatusInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrl()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatusInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrl()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl _property; /// The properties of the resource generated. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrl()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrl()); set => this._property = value; } /// /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)Property).ReportUrl1; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)Property).ReportUrl1 = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema)""); } + public string ReportUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)Property).ReportUrl1; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)Property).ReportUrl1 = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType? _status; + private string _status; /// The status of the long running operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// The time at which report URL becomes invalid. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? ValidUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)Property).ValidUntil; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)Property).ValidUntil = value ?? default(global::System.DateTime); } + public global::System.DateTime? ValidUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)Property).ValidUntil; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)Property).ValidUntil = value ?? default(global::System.DateTime); } /// Creates an new instance. public OperationStatus() @@ -56,22 +56,33 @@ public partial interface IOperationStatus : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity", SerializedName = @"reportUrl", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("InstanceFlexibilityGroup", "InstanceFlexibilityRatio", "InstanceId", "Kind", "ReservationId", "ReservationOrderId", "ReservedHours", "SkuName", "TotalReservedQuantity", "UsageDate", "UsedHours")] + string ReportUrl { get; set; } /// The status of the long running operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the long running operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Running", "Completed", "Failed")] + string Status { get; set; } /// The time at which report URL becomes invalid. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time at which report URL becomes invalid.", SerializedName = @"validUntil", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -83,13 +94,15 @@ public partial interface IOperationStatusInternal { /// The properties of the resource generated. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl Property { get; set; } /// /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("InstanceFlexibilityGroup", "InstanceFlexibilityRatio", "InstanceId", "Kind", "ReservationId", "ReservationOrderId", "ReservedHours", "SkuName", "TotalReservedQuantity", "UsageDate", "UsedHours")] + string ReportUrl { get; set; } /// The status of the long running operation. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Running", "Completed", "Failed")] + string Status { get; set; } /// The time at which report URL becomes invalid. global::System.DateTime? ValidUntil { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.json.cs index e932c162a860..29797e6fdcb6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/OperationStatus.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/OperationStatus.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationStatus partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new OperationStatus(json) : null; } @@ -77,8 +77,8 @@ internal OperationStatus(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportUrl.FromJson(__jsonProperties) : Property;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportUrl.FromJson(__jsonProperties) : _property;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.PowerShell.cs index 63d99fe2cc24..d8ee185a7f5d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PivotProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PivotProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PivotProperties(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal PivotProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal PivotProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal PivotProperties(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Each pivot must contain a 'type' and 'name'. [System.ComponentModel.TypeConverter(typeof(PivotPropertiesTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.TypeConverter.cs index f51b72e71159..29221071c5d3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.cs similarity index 80% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.cs index f1e1c2e35ec1..d9ecd03803c4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Each pivot must contain a 'type' and 'name'. public partial class PivotProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotPropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class PivotProperties : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType? _type; + private string _type; /// Data type to show in view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public PivotProperties() @@ -41,6 +41,9 @@ public partial interface IPivotProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Data field to show in view.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,14 @@ public partial interface IPivotProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Data type to show in view.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Dimension", "TagKey")] + string Type { get; set; } } /// Each pivot must contain a 'type' and 'name'. @@ -62,7 +69,8 @@ public partial interface IPivotPropertiesInternal /// Data field to show in view. string Name { get; set; } /// Data type to show in view. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Dimension", "TagKey")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.json.cs index af20fd4b8551..826fc5d2cf4c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/PivotProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/PivotProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PivotProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new PivotProperties(json) : null; } @@ -77,8 +77,8 @@ internal PivotProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index 1732a210bbc9..31156f63e651 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ProxyResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal ProxyResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The Resource model definition. [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index 1696473384c2..8ac825ba4bab 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.cs similarity index 90% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.cs index 8bb4b4c2bac1..6403c075ec75 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The Resource model definition. public partial class ProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal { /// Backing field for property. @@ -31,13 +31,13 @@ public partial class ProxyResource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -70,6 +70,9 @@ public partial interface IProxyResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"eTag", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +81,9 @@ public partial interface IProxyResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface IProxyResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -94,6 +103,9 @@ public partial interface IProxyResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.json.cs index d810cb0db129..b01364b124fb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ProxyResource.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ProxyResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ProxyResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; } @@ -77,10 +77,10 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)_eTag;} AfterFromJson(json); } @@ -103,15 +103,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.PowerShell.cs index 98628b9508a2..a1a5342a6041 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryAggregation(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal QueryAggregation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal QueryAggregation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal QueryAggregation(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The aggregation expression to be used in the query. [System.ComponentModel.TypeConverter(typeof(QueryAggregationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.TypeConverter.cs index ed1cef7e9d28..784bfa73f522 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.cs index b0bc75e14c9d..1161f411f54b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The aggregation expression to be used in the query. public partial class QueryAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class QueryAggregation : public string Function { get => this._function; } /// Internal Acessors for Function - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregationInternal.Function { get => this._function; set { {_function = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregationInternal.Function { get => this._function; set { {_function = value;} } } /// Backing field for property. private string _name; @@ -44,6 +44,9 @@ public partial interface IQueryAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of the aggregation function to use.", SerializedName = @"function", PossibleTypes = new [] { typeof(string) })] @@ -52,6 +55,9 @@ public partial interface IQueryAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to aggregate.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.json.cs index 4715f24fd5e4..58a9a72f400b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryAggregation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryAggregation(json) : null; } @@ -77,8 +77,8 @@ internal QueryAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runt { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)Function;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)_function;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.PowerShell.cs similarity index 75% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.PowerShell.cs index bd47f2a7487c..c8605554587a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryColumn partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryColumn(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryColumn(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal QueryColumn(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal QueryColumn(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal QueryColumn(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// QueryColumn properties [System.ComponentModel.TypeConverter(typeof(QueryColumnTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.TypeConverter.cs index 24883db0beac..d7b25605aea7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.cs index 65909d58333b..5d9eeac5dcd2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// QueryColumn properties public partial class QueryColumn : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumnInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumnInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IQueryColumn : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of column.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IQueryColumn : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of column.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.json.cs index b8de25269835..86406070cf1c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryColumn.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryColumn.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryColumn partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryColumn(json) : null; } @@ -77,8 +77,8 @@ internal QueryColumn(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.J { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.PowerShell.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.PowerShell.cs index 69c88d1ae82e..540849d971ba 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class QueryComparisonExpression partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryComparisonExpression(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryComparisonExpression(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal QueryComparisonExpression(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +140,15 @@ internal QueryComparisonExpression(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal QueryComparisonExpression(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The comparison expression to be used in the query. [System.ComponentModel.TypeConverter(typeof(QueryComparisonExpressionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.TypeConverter.cs index 6f814f69dbe1..98026e72f134 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.cs similarity index 84% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.cs index dc4199ded033..c66f850bcf95 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The comparison expression to be used in the query. public partial class QueryComparisonExpression : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal { /// Internal Acessors for Operator - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } /// Backing field for property. private string _name; @@ -31,11 +31,11 @@ public partial class QueryComparisonExpression : public string Operator { get => this._operator; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public QueryComparisonExpression() @@ -51,6 +51,9 @@ public partial interface IQueryComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IQueryComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", PossibleTypes = new [] { typeof(string) })] @@ -67,10 +73,13 @@ public partial interface IQueryComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// The comparison expression to be used in the query. @@ -82,7 +91,7 @@ public partial interface IQueryComparisonExpressionInternal /// The operator to use for comparison. string Operator { get; set; } /// Array of values to use for comparison - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.json.cs index 98d3651ee991..cf7f86381d6c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryComparisonExpression.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryComparisonExpression partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryComparisonExpression(json) : null; } @@ -77,9 +77,9 @@ internal QueryComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.PowerShell.cs similarity index 58% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.PowerShell.cs index 4a19bf9f6770..57859d69585c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryDataset partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryDataset(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryDataset(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal QueryDataset(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("Aggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregationTypeConverter.ConvertFrom); } if (content.Contains("Grouping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Grouping = (System.Collections.Generic.List) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGroupingTypeConverter.ConvertFrom)); } if (content.Contains("Filter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal QueryDataset(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("Aggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregationTypeConverter.ConvertFrom); } if (content.Contains("Grouping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Grouping = (System.Collections.Generic.List) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGroupingTypeConverter.ConvertFrom)); } if (content.Contains("Filter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal QueryDataset(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The definition of data present in the query. [System.ComponentModel.TypeConverter(typeof(QueryDatasetTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.TypeConverter.cs index 0f41cc7e468b..c7390592aac4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.cs index c0a7b60c017b..b097562e7e85 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.cs @@ -3,71 +3,71 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of data present in the query. public partial class QueryDataset : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation _aggregation; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation _aggregation; /// /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregation()); set => this._aggregation = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregation()); set => this._aggregation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration _configuration; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration _configuration; /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfiguration()); set => this._configuration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfiguration()); set => this._configuration = value; } /// /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter _filter; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter _filter; /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter()); set => this._filter = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter()); set => this._filter = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? _granularity; + private string _granularity; /// The granularity of rows in the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + public string Granularity { get => this._granularity; set => this._granularity = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] _grouping; + private System.Collections.Generic.List _grouping; /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] Grouping { get => this._grouping; set => this._grouping = value; } + public System.Collections.Generic.List Grouping { get => this._grouping; set => this._grouping = value; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfiguration()); set { {_configuration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfiguration()); set { {_configuration = value;} } } /// Creates an new instance. public QueryDataset() @@ -86,10 +86,13 @@ public partial interface IQueryDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation Aggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation Aggregation { get; set; } /// /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. @@ -97,10 +100,13 @@ public partial interface IQueryDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. @@ -108,28 +114,38 @@ public partial interface IQueryDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format the filter.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Filter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Filter { get; set; } /// The granularity of rows in the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the query.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the query. Query can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] Grouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping) })] + System.Collections.Generic.List Grouping { get; set; } } /// The definition of data present in the query. @@ -140,28 +156,29 @@ public partial interface IQueryDatasetInternal /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation Aggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation Aggregation { get; set; } /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration Configuration { get; set; } /// /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Filter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Filter { get; set; } /// The granularity of rows in the query. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? Granularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string Granularity { get; set; } /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] Grouping { get; set; } + System.Collections.Generic.List Grouping { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.json.cs similarity index 89% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.json.cs index 1f461760b94c..498622640967 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDataset.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDataset.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryDataset partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryDataset(json) : null; } @@ -77,11 +77,11 @@ internal QueryDataset(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime. { return; } - {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} - {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)Granularity;} - {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} - {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryGrouping.FromJson(__u) )) ))() : null : Grouping;} - {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__jsonFilter) : Filter;} + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfiguration.FromJson(__jsonConfiguration) : _configuration;} + {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)_granularity;} + {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregation.FromJson(__jsonAggregation) : _aggregation;} + {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGrouping.FromJson(__u) )) ))() : null : _grouping;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter.FromJson(__jsonFilter) : _filter;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.PowerShell.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.PowerShell.cs index 66de6ab96b98..91a2fc30a013 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,29 +58,35 @@ public partial class QueryDatasetAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryDatasetAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryDatasetAggregation(content); } @@ -90,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -112,7 +118,7 @@ internal QueryDatasetAggregation(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,6 +140,18 @@ internal QueryDatasetAggregation(global::System.Management.Automation.PSObject c /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.TypeConverter.cs index 1aed99b7586a..d2c2344092ec 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.cs index 804676034054..4a998c49b3af 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// aggregated column. Query can have up to 2 aggregation clauses. /// public partial class QueryDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregationInternal { /// Creates an new instance. @@ -26,7 +26,7 @@ public QueryDatasetAggregation() /// aggregated column. Query can have up to 2 aggregation clauses. public partial interface IQueryDatasetAggregation : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.dictionary.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.dictionary.cs index 2332ecd20c1f..1f4340c943fd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.dictionary.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; public partial class QueryDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryAggregation value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryAggregation value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDatasetAggregation source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregation source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.json.cs index fd1b44297433..1ecd52b27ee2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class QueryDatasetAggregation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryDatasetAggregation(json) : null; } @@ -81,7 +81,7 @@ internal QueryDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostManageme { return; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryAggregation.FromJson(j) ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryAggregation.FromJson(j) ,exclusions ); AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.PowerShell.cs similarity index 75% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.PowerShell.cs index d5d58a8641af..deaf909f2e99 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class QueryDatasetConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryDatasetConfiguration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryDatasetConfiguration(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal QueryDatasetConfiguration(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal QueryDatasetConfiguration(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal QueryDatasetConfiguration(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration of dataset in the query. [System.ComponentModel.TypeConverter(typeof(QueryDatasetConfigurationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.TypeConverter.cs index ab7e4982011d..24f612cc3556 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.cs similarity index 84% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.cs index 62f436fe18cd..d36dd80be749 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The configuration of dataset in the query. public partial class QueryDatasetConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfigurationInternal { /// Backing field for property. - private string[] _column; + private System.Collections.Generic.List _column; /// /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Creates an new instance. public QueryDatasetConfiguration() @@ -40,10 +40,13 @@ public partial interface IQueryDatasetConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } /// The configuration of dataset in the query. @@ -54,7 +57,7 @@ public partial interface IQueryDatasetConfigurationInternal /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. /// - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.json.cs index 14d5a1a6750f..8f404807e5d8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDatasetConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryDatasetConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryDatasetConfiguration(json) : null; } @@ -77,7 +77,7 @@ internal QueryDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.CostManage { return; } - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _column;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.PowerShell.cs new file mode 100644 index 000000000000..3cf62777d392 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.PowerShell.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The definition of a query. + [System.ComponentModel.TypeConverter(typeof(QueryDefinitionTypeConverter))] + public partial class QueryDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatasetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGranularity = (string) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatasetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGranularity = (string) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The definition of a query. + [System.ComponentModel.TypeConverter(typeof(QueryDefinitionTypeConverter))] + public partial interface IQueryDefinition + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.TypeConverter.cs index ece1e2d79604..475824d70250 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.cs similarity index 63% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.cs index be247e433736..78bfe284fa76 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of a query. public partial class QueryDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal { /// @@ -18,78 +18,78 @@ public partial class QueryDefinition : /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset _dataset; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset _dataset; /// Has definition for data in this query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDataset()); set => this._dataset = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDataset()); set => this._dataset = value; } /// /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Aggregation = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Aggregation = value ?? null /* model class */; } /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Filter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Filter = value ?? null /* model class */; } /// The granularity of rows in the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); } + public string DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Granularity = value ?? null; } /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Grouping = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DatasetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Grouping = value ?? null /* arrayOf */; } /// Internal Acessors for Dataset - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDataset()); set { {_dataset = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDataset()); set { {_dataset = value;} } } /// Internal Acessors for DatasetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetInternal)Dataset).Configuration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetInternal)Dataset).Configuration = value; } /// Internal Acessors for TimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriod()); set { {_timePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriod()); set { {_timePeriod = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod _timePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod _timePeriod; /// Has time period for pulling data for the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriod()); set => this._timePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriod()); set => this._timePeriod = value; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } /// The end date to pull data to. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType _timeframe; + private string _timeframe; /// /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + public string Timeframe { get => this._timeframe; set => this._timeframe = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType _type; + private string _type; /// The type of the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public QueryDefinition() @@ -108,10 +108,13 @@ public partial interface IQueryDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. @@ -119,10 +122,13 @@ public partial interface IQueryDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation DatasetAggregation { get; set; } /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. @@ -130,32 +136,45 @@ public partial interface IQueryDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format the filter.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter DatasetFilter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter DatasetFilter { get; set; } /// The granularity of rows in the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the query.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DatasetGranularity { get; set; } /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the query. Query can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping) })] + System.Collections.Generic.List DatasetGrouping { get; set; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -164,6 +183,9 @@ public partial interface IQueryDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -174,18 +196,26 @@ public partial interface IQueryDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the query. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string Timeframe { get; set; } /// The type of the query. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the query.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } /// The definition of a query. @@ -196,32 +226,33 @@ public partial interface IQueryDefinitionInternal /// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Has definition for data in this query. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDataset Dataset { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDataset Dataset { get; set; } /// /// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the /// aggregated column. Query can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetAggregation DatasetAggregation { get; set; } /// /// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDatasetConfiguration DatasetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDatasetConfiguration DatasetConfiguration { get; set; } /// /// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format /// the filter. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter DatasetFilter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter DatasetFilter { get; set; } /// The granularity of rows in the query. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType? DatasetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + string DatasetGranularity { get; set; } /// /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get; set; } + System.Collections.Generic.List DatasetGrouping { get; set; } /// Has time period for pulling data for the query. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod TimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod TimePeriod { get; set; } /// The start date to pull data from. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date to pull data to. @@ -229,9 +260,11 @@ public partial interface IQueryDefinitionInternal /// /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Timeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + string Timeframe { get; set; } /// The type of the query. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.json.cs index 64102e1dadd5..3c7b4df6a4dd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryDefinition(json) : null; } @@ -77,10 +77,10 @@ internal QueryDefinition(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} - {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryDataset.FromJson(__jsonDataset) : Dataset;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)Timeframe;} + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryTimePeriod.FromJson(__jsonTimePeriod) : _timePeriod;} + {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryDataset.FromJson(__jsonDataset) : _dataset;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)_timeframe;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.PowerShell.cs similarity index 58% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.PowerShell.cs index 1d411f96d863..ede21d02ef86 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryFilter(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,29 +111,29 @@ internal QueryFilter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom)); } if (content.Contains("Not")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Not = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Not",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Not, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Not = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("Not",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Not, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); } if (content.Contains("Dimensions")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Dimensions = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Dimensions",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Dimensions, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Dimensions = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) content.GetValueForProperty("Dimensions",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Dimensions, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpressionTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,23 +148,23 @@ internal QueryFilter(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom)); } if (content.Contains("Not")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Not = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Not",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Not, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Not = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) content.GetValueForProperty("Not",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Not, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilterTypeConverter.ConvertFrom); } if (content.Contains("Dimensions")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Dimensions = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Dimensions",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Dimensions, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Dimensions = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) content.GetValueForProperty("Dimensions",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Dimensions, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpressionTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -165,6 +173,18 @@ internal QueryFilter(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The filter expression to be used in the export. [System.ComponentModel.TypeConverter(typeof(QueryFilterTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.TypeConverter.cs index b4c4747d47ed..b9bcbcc204ef 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.cs similarity index 67% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.cs index dc59e06dc65e..88d2002baf53 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.cs @@ -3,50 +3,50 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The filter expression to be used in the export. public partial class QueryFilter : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilterInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] _and; + private System.Collections.Generic.List _and; /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] And { get => this._and; set => this._and = value; } + public System.Collections.Generic.List And { get => this._and; set => this._and = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression _dimensions; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression _dimensions; /// Has comparison expression for a dimension [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Dimensions { get => (this._dimensions = this._dimensions ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression()); set => this._dimensions = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Dimensions { get => (this._dimensions = this._dimensions ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression()); set => this._dimensions = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter _not; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter _not; /// The logical "NOT" expression. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Not { get => (this._not = this._not ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter()); set => this._not = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Not { get => (this._not = this._not ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter()); set => this._not = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] _or; + private System.Collections.Generic.List _or; /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] Or { get => this._or; set => this._or = value; } + public System.Collections.Generic.List Or { get => this._or; set => this._or = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression _tag; /// Has comparison expression for a tag [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression()); set => this._tag = value; } /// Creates an new instance. public QueryFilter() @@ -62,42 +62,57 @@ public partial interface IQueryFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""AND"" expression. Must have at least 2 items.", SerializedName = @"and", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] And { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) })] + System.Collections.Generic.List And { get; set; } /// Has comparison expression for a dimension [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has comparison expression for a dimension", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Dimensions { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Dimensions { get; set; } /// The logical "NOT" expression. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""NOT"" expression.", SerializedName = @"not", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Not { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Not { get; set; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""OR"" expression. Must have at least 2 items.", SerializedName = @"or", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] Or { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) })] + System.Collections.Generic.List Or { get; set; } /// Has comparison expression for a tag [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has comparison expression for a tag", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Tag { get; set; } } /// The filter expression to be used in the export. @@ -105,15 +120,15 @@ public partial interface IQueryFilterInternal { /// The logical "AND" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] And { get; set; } + System.Collections.Generic.List And { get; set; } /// Has comparison expression for a dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Dimensions { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Dimensions { get; set; } /// The logical "NOT" expression. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter Not { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter Not { get; set; } /// The logical "OR" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[] Or { get; set; } + System.Collections.Generic.List Or { get; set; } /// Has comparison expression for a tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryComparisonExpression Tag { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.json.cs similarity index 86% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.json.cs index 51e05cf8589d..84833346ddf6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryFilter(json) : null; } @@ -77,11 +77,11 @@ internal QueryFilter(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.J { return; } - {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__u) )) ))() : null : And;} - {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__p) )) ))() : null : Or;} - {_not = If( json?.PropertyT("not"), out var __jsonNot) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__jsonNot) : Not;} - {_dimensions = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonDimensions) : Dimensions;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter.FromJson(__u) )) ))() : null : _and;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter.FromJson(__p) )) ))() : null : _or;} + {_not = If( json?.PropertyT("not"), out var __jsonNot) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryFilter.FromJson(__jsonNot) : _not;} + {_dimensions = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression.FromJson(__jsonDimensions) : _dimensions;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryComparisonExpression.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.PowerShell.cs similarity index 75% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.PowerShell.cs index e584d1dabcc5..6a47b7784202 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryGrouping partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryGrouping(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryGrouping(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal QueryGrouping(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal QueryGrouping(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal QueryGrouping(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The group by expression to be used in the query. [System.ComponentModel.TypeConverter(typeof(QueryGroupingTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.TypeConverter.cs index 1f1a2efbb5e5..cd1f9420252d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.cs similarity index 80% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.cs index 7d41b58e5c92..023f6b00e8b5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The group by expression to be used in the query. public partial class QueryGrouping : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGroupingInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGroupingInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class QueryGrouping : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType _type; + private string _type; /// Has type of the column to group. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public QueryGrouping() @@ -41,6 +41,9 @@ public partial interface IQueryGrouping : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to group.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,14 @@ public partial interface IQueryGrouping : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has type of the column to group.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Tag", "Dimension")] + string Type { get; set; } } /// The group by expression to be used in the query. @@ -62,7 +69,8 @@ public partial interface IQueryGroupingInternal /// The name of the column to group. string Name { get; set; } /// Has type of the column to group. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Tag", "Dimension")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.json.cs index 18f1c0061108..61d948f503a4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryGrouping.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryGrouping.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryGrouping partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryGrouping(json) : null; } @@ -77,8 +77,8 @@ internal QueryGrouping(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.PowerShell.cs similarity index 65% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.PowerShell.cs index 7f6ae263924d..308c8013f20d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryProperties(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal QueryProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Row = (string[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, global::System.Convert.ToString))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,15 +140,15 @@ internal QueryProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Row = (string[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, global::System.Convert.ToString))); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal QueryProperties(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Query properties [System.ComponentModel.TypeConverter(typeof(QueryPropertiesTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.TypeConverter.cs index 372dc93d0263..2f3fe302fee4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.cs similarity index 71% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.cs index 32b45ee7cfd5..2f0c9a486496 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Query properties public partial class QueryProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] _column; + private System.Collections.Generic.List _column; /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Backing field for property. private string _nextLink; @@ -28,11 +28,11 @@ public partial class QueryProperties : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private string[][] _row; + private System.Collections.Generic.List> _row; /// Array of rows [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[][] Row { get => this._row; set => this._row = value; } + public System.Collections.Generic.List> Row { get => this._row; set => this._row = value; } /// Creates an new instance. public QueryProperties() @@ -48,14 +48,20 @@ public partial interface IQueryProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of columns", SerializedName = @"columns", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn) })] + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -64,10 +70,13 @@ public partial interface IQueryProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of rows", SerializedName = @"rows", PossibleTypes = new [] { typeof(string) })] - string[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } /// Query properties @@ -75,11 +84,11 @@ public partial interface IQueryPropertiesInternal { /// Array of columns - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. string NextLink { get; set; } /// Array of rows - string[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.json.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.json.cs index c87adf168090..f422de4e7c12 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryProperties(json) : null; } @@ -77,9 +77,9 @@ internal QueryProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumn.FromJson(__u) )) ))() : null : Column;} - {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__p, (__o)=>(string[]) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __n) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__n, (__m)=>(string) (__m is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __l ? (string)(__l.ToString()) : null)) ))() : null /* arrayOf */)) ))() : null : Row;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumn.FromJson(__u) )) ))() : null : _column;} + {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __p) ? new global::System.Func>>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__p, (__o)=>(System.Collections.Generic.List) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __n) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__n, (__m)=>(string) (__m is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __l ? (string)(__l.ToString()) : null)) ))() : null /* arrayOf */)) ))() : null : _row;} AfterFromJson(json); } @@ -117,7 +117,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T var __r = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(); foreach( var __s in this._row ) { - AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__s, (__q) => null != (((object)__q)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(__q.ToString()) : null))) : null ,__r.Add); + AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(__s, (__q) => null != (((object)__q)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(__q.ToString()) : null))) : null ,__r.Add); } container.Add("rows",__r); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.PowerShell.cs similarity index 56% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.PowerShell.cs index 709902ea6a24..7aa7411ad0fb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class QueryResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,53 +113,53 @@ internal QueryResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Row = (string[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, global::System.Convert.ToString))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -166,47 +174,47 @@ internal QueryResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryColumnTypeConverter.ConvertFrom)); } if (content.Contains("Row")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Row = (string[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Row = (System.Collections.Generic.List>) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToList>(__y, __w => TypeConverterExtensions.SelectToList(__w, global::System.Convert.ToString))); } AfterDeserializePSObject(content); } @@ -215,6 +223,18 @@ internal QueryResult(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of query. It contains all columns listed under groupings and aggregation. [System.ComponentModel.TypeConverter(typeof(QueryResultTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.TypeConverter.cs index 665f0382f2f9..07830bcd37f5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.cs similarity index 60% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.cs index 24dc78d84bc6..3cb8e5f34111 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -11,97 +11,101 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// Result of query. It contains all columns listed under groupings and aggregation. /// public partial class QueryResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(); /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 0)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } /// ETag of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; } /// Location of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryProperties()); set { {_property = value;} } } /// Internal Acessors for ETag - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).ETag = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Location - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Location = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Location = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Sku - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku = value; } /// Internal Acessors for Tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Name; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).NextLink = value ?? null; } + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).NextLink = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties _property; /// Query properties [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Array of rows [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.FormatTable(Index = 1)] - public string[][] Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } + public System.Collections.Generic.List> Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } /// SKU of the resource. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Sku; } + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Sku; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Tag; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Tag; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public QueryResult() @@ -124,20 +128,26 @@ public QueryResult() /// Result of query. It contains all columns listed under groupings and aggregation. public partial interface IQueryResult : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource { /// Array of columns [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of columns", SerializedName = @"columns", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryColumn) })] + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -146,24 +156,27 @@ public partial interface IQueryResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of rows", SerializedName = @"rows", PossibleTypes = new [] { typeof(string) })] - string[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } /// Result of query. It contains all columns listed under groupings and aggregation. public partial interface IQueryResultInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal { /// Array of columns - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryColumn[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } /// The link (url) to the next page of results. string NextLink { get; set; } /// Query properties - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryProperties Property { get; set; } /// Array of rows - string[][] Row { get; set; } + System.Collections.Generic.List> Row { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.json.cs index 07bb5ff98c48..6a235e9a7f1e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class QueryResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryResult(json) : null; } @@ -79,8 +79,8 @@ internal QueryResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.QueryProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.PowerShell.cs index b02b5f33ff04..874b6eafd790 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class QueryTimePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QueryTimePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QueryTimePeriod(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal QueryTimePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal QueryTimePeriod(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal QueryTimePeriod(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The start and end date for pulling data for the query. [System.ComponentModel.TypeConverter(typeof(QueryTimePeriodTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.TypeConverter.cs index bad844fe24a5..2686fc26edff 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.cs index e59e13f21e7c..66f9ca063114 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The start and end date for pulling data for the query. public partial class QueryTimePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriodInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IQueryTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -49,6 +52,9 @@ public partial interface IQueryTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.json.cs index 4a8e1a431d5d..24c56202af6c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryTimePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/QueryTimePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QueryTimePeriod partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IQueryTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new QueryTimePeriod(json) : null; } @@ -77,8 +77,8 @@ internal QueryTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runti { return; } - {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : From : From;} - {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : To : To;} + {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : _from : _from;} + {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : _to : _to;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.PowerShell.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.PowerShell.cs index 233b4244e38e..ba6e18c56977 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ReportConfigAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigAggregation(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ReportConfigAggregation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal ReportConfigAggregation(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Function")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal)this).Function, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal)this).Function, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ReportConfigAggregation(global::System.Management.Automation.PSObject c /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The aggregation expression to be used in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigAggregationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.TypeConverter.cs index 4bf3248a1f0b..9be7981b829b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.cs index 89558bc8d4aa..a66f5e666846 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The aggregation expression to be used in the report. public partial class ReportConfigAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class ReportConfigAggregation : public string Function { get => this._function; } /// Internal Acessors for Function - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregationInternal.Function { get => this._function; set { {_function = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregationInternal.Function { get => this._function; set { {_function = value;} } } /// Backing field for property. private string _name; @@ -44,6 +44,9 @@ public partial interface IReportConfigAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of the aggregation function to use.", SerializedName = @"function", PossibleTypes = new [] { typeof(string) })] @@ -52,6 +55,9 @@ public partial interface IReportConfigAggregation : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to aggregate.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.json.cs index b489470877f6..71256ec0b378 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigAggregation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigAggregation(json) : null; } @@ -77,8 +77,8 @@ internal ReportConfigAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostManageme { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)Function;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_function = If( json?.PropertyT("function"), out var __jsonFunction) ? (string)__jsonFunction : (string)_function;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.PowerShell.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.PowerShell.cs index dcd9d345be13..43239423c0e8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ReportConfigComparisonExpression partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigComparisonExpression(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigComparisonExpression(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +113,21 @@ internal ReportConfigComparisonExpression(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal ReportConfigComparisonExpression(global::System.Management.Automation.P // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal ReportConfigComparisonExpression(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The comparison expression to be used in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigComparisonExpressionTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.TypeConverter.cs index 1f80ed34fd01..fb0ad4c1c628 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.cs similarity index 77% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.cs index 60901109bc9a..476aef86df3b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The comparison expression to be used in the report. public partial class ReportConfigComparisonExpression : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpressionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpressionInternal { /// Backing field for property. @@ -21,18 +21,18 @@ public partial class ReportConfigComparisonExpression : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType _operator; + private string _operator; /// The operator to use for comparison. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ReportConfigComparisonExpression() @@ -48,6 +48,9 @@ public partial interface IReportConfigComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to use in comparison.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -56,18 +59,25 @@ public partial interface IReportConfigComparisonExpression : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The operator to use for comparison.", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("In", "Contains")] + string Operator { get; set; } /// Array of values to use for comparison [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of values to use for comparison", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// The comparison expression to be used in the report. @@ -77,9 +87,10 @@ public partial interface IReportConfigComparisonExpressionInternal /// The name of the column to use in comparison. string Name { get; set; } /// The operator to use for comparison. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("In", "Contains")] + string Operator { get; set; } /// Array of values to use for comparison - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.json.cs index 0b0a97f03833..0bb7befbf86e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigComparisonExpression.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigComparisonExpression partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigComparisonExpression(json) : null; } @@ -77,9 +77,9 @@ internal ReportConfigComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.Cos { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.PowerShell.cs similarity index 54% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.PowerShell.cs index ee1b42ee7b99..eb74c469f0e4 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReportConfigDataset partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigDataset(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigDataset(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,37 +111,37 @@ internal ReportConfigDataset(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("Aggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); } if (content.Contains("Grouping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Grouping = (System.Collections.Generic.List) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); } if (content.Contains("Sorting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Sorting = (System.Collections.Generic.List) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); } if (content.Contains("Filter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,31 +156,31 @@ internal ReportConfigDataset(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); } if (content.Contains("Granularity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Granularity = (string) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Granularity, global::System.Convert.ToString); } if (content.Contains("Aggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); } if (content.Contains("Grouping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Grouping = (System.Collections.Generic.List) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); } if (content.Contains("Sorting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Sorting = (System.Collections.Generic.List) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); } if (content.Contains("Filter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal ReportConfigDataset(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The definition of data present in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.TypeConverter.cs index f40563e7b787..1cb72942d516 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.cs similarity index 65% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.cs index 4e2ec0c6599d..75e891351eff 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.cs @@ -3,75 +3,75 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of data present in the report. public partial class ReportConfigDataset : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation _aggregation; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation _aggregation; /// /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregation()); set => this._aggregation = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregation()); set => this._aggregation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration _configuration; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration _configuration; /// /// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping /// are provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfiguration()); set => this._configuration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfiguration()); set => this._configuration = value; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter _filter; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter _filter; /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilter()); set => this._filter = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilter()); set => this._filter = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? _granularity; + private string _granularity; /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + public string Granularity { get => this._granularity; set => this._granularity = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] _grouping; + private System.Collections.Generic.List _grouping; /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] Grouping { get => this._grouping; set => this._grouping = value; } + public System.Collections.Generic.List Grouping { get => this._grouping; set => this._grouping = value; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfiguration()); set { {_configuration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfiguration()); set { {_configuration = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] _sorting; + private System.Collections.Generic.List _sorting; /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] Sorting { get => this._sorting; set => this._sorting = value; } + public System.Collections.Generic.List Sorting { get => this._sorting; set => this._sorting = value; } /// Creates an new instance. public ReportConfigDataset() @@ -90,10 +90,13 @@ public partial interface IReportConfigDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation Aggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation Aggregation { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. @@ -101,44 +104,60 @@ public partial interface IReportConfigDataset : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has filter expression to use in the report.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter Filter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter Filter { get; set; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the report.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? Granularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string Granularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the report. Report can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] Grouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping) })] + System.Collections.Generic.List Grouping { get; set; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of order by expression to use in the report.", SerializedName = @"sorting", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] Sorting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting) })] + System.Collections.Generic.List Sorting { get; set; } } /// The definition of data present in the report. @@ -149,27 +168,28 @@ public partial interface IReportConfigDatasetInternal /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation Aggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation Aggregation { get; set; } /// /// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Configuration { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Has filter expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter Filter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter Filter { get; set; } /// The granularity of rows in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? Granularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string Granularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] Grouping { get; set; } + System.Collections.Generic.List Grouping { get; set; } /// Array of order by expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] Sorting { get; set; } + System.Collections.Generic.List Sorting { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.json.cs similarity index 85% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.json.cs index 06cba02eeb9a..1fd90f72b912 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDataset.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDataset.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigDataset partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigDataset(json) : null; } @@ -77,12 +77,12 @@ internal ReportConfigDataset(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} - {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)Granularity;} - {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} - {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigGrouping.FromJson(__u) )) ))() : null : Grouping;} - {_sorting = If( json?.PropertyT("sorting"), out var __jsonSorting) ? If( __jsonSorting as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigSorting.FromJson(__p) )) ))() : null : Sorting;} - {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilter.FromJson(__jsonFilter) : Filter;} + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfiguration.FromJson(__jsonConfiguration) : _configuration;} + {_granularity = If( json?.PropertyT("granularity"), out var __jsonGranularity) ? (string)__jsonGranularity : (string)_granularity;} + {_aggregation = If( json?.PropertyT("aggregation"), out var __jsonAggregation) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregation.FromJson(__jsonAggregation) : _aggregation;} + {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGrouping.FromJson(__u) )) ))() : null : _grouping;} + {_sorting = If( json?.PropertyT("sorting"), out var __jsonSorting) ? If( __jsonSorting as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSorting.FromJson(__p) )) ))() : null : _sorting;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilter.FromJson(__jsonFilter) : _filter;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.PowerShell.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.PowerShell.cs index 9d2cb7a035e6..b3715e5d4b8d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -58,29 +58,35 @@ public partial class ReportConfigDatasetAggregation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigDatasetAggregation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigDatasetAggregation(content); } @@ -90,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -112,7 +118,7 @@ internal ReportConfigDatasetAggregation(global::System.Collections.IDictionary c } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,6 +140,18 @@ internal ReportConfigDatasetAggregation(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.TypeConverter.cs index db121a69157c..62e940e6e06e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.cs index 4f7d0ee3a4ed..3ba8e48aab76 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 /// aggregated column. Report can have up to 2 aggregation clauses. /// public partial class ReportConfigDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregationInternal { /// Creates an new instance. @@ -26,7 +26,7 @@ public ReportConfigDatasetAggregation() /// aggregated column. Report can have up to 2 aggregation clauses. public partial interface IReportConfigDatasetAggregation : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.dictionary.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.dictionary.cs index cb4ff5434325..bab96d59ca66 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.dictionary.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; public partial class ReportConfigDatasetAggregation : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigAggregation value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigAggregation value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDatasetAggregation source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregation source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.json.cs index 7ece4f34c7ca..f1f7a30a59c6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetAggregation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class ReportConfigDatasetAggregation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigDatasetAggregation(json) : null; } @@ -81,7 +81,7 @@ internal ReportConfigDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.CostM { return; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigAggregation.FromJson(j) ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigAggregation.FromJson(j) ,exclusions ); AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.PowerShell.cs similarity index 75% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.PowerShell.cs index dba1bae550d9..cf4d45a452c7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ReportConfigDatasetConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigDatasetConfiguration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigDatasetConfiguration(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +113,13 @@ internal ReportConfigDatasetConfiguration(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +134,7 @@ internal ReportConfigDatasetConfiguration(global::System.Management.Automation.P // actually deserialize if (content.Contains("Column")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)this).Column = (System.Collections.Generic.List) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal)this).Column, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -135,6 +143,18 @@ internal ReportConfigDatasetConfiguration(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration of dataset in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetConfigurationTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.TypeConverter.cs index 0a0403f78e58..ac39401c151b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.cs similarity index 84% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.cs index 753f7fae5eef..c867728b08fc 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The configuration of dataset in the report. public partial class ReportConfigDatasetConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfigurationInternal { /// Backing field for property. - private string[] _column; + private System.Collections.Generic.List _column; /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public string[] Column { get => this._column; set => this._column = value; } + public System.Collections.Generic.List Column { get => this._column; set => this._column = value; } /// Creates an new instance. public ReportConfigDatasetConfiguration() @@ -40,10 +40,13 @@ public partial interface IReportConfigDatasetConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } /// The configuration of dataset in the report. @@ -54,7 +57,7 @@ public partial interface IReportConfigDatasetConfigurationInternal /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// - string[] Column { get; set; } + System.Collections.Generic.List Column { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.json.cs index 4f79d060c4ad..ee8b373427f7 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDatasetConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigDatasetConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigDatasetConfiguration(json) : null; } @@ -77,7 +77,7 @@ internal ReportConfigDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Cos { return; } - {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _column;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.PowerShell.cs new file mode 100644 index 000000000000..20da00923b23 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.PowerShell.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The definition of a report config. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDefinitionTypeConverter))] + public partial class ReportConfigDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportConfigDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The definition of a report config. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDefinitionTypeConverter))] + public partial interface IReportConfigDefinition + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.TypeConverter.cs index 51d00e5f670b..8b6f98ad7862 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.cs similarity index 66% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.cs index 2b5eda683240..be20717dc80b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The definition of a report config. public partial class ReportConfigDefinition : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal { /// @@ -18,39 +18,39 @@ public partial class ReportConfigDefinition : /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset _dataSet; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset _dataSet; /// Has definition for data in this report config. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDataset()); set => this._dataSet = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDataset()); set => this._dataSet = value; } /// /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Aggregation = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Aggregation = value ?? null /* model class */; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Filter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Filter = value ?? null /* model class */; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Granularity = value ?? null; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Grouping = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Grouping = value ?? null /* arrayOf */; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Sorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Sorting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Sorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Sorting = value ?? null /* arrayOf */; } /// Backing field for property. private bool? _includeMonetaryCommitment; @@ -60,40 +60,40 @@ public partial class ReportConfigDefinition : public bool? IncludeMonetaryCommitment { get => this._includeMonetaryCommitment; set => this._includeMonetaryCommitment = value; } /// Internal Acessors for DataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDataset()); set { {_dataSet = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDataset()); set { {_dataSet = value;} } } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Configuration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetInternal)DataSet).Configuration = value; } /// Internal Acessors for TimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriod()); set { {_timePeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriod()); set { {_timePeriod = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod _timePeriod; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod _timePeriod; /// Has time period for pulling data for the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriod()); set => this._timePeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriod()); set => this._timePeriod = value; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } /// The end date to pull data to. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType _timeframe; + private string _timeframe; /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + public string Timeframe { get => this._timeframe; set => this._timeframe = value; } /// Backing field for property. private string _type= @"Usage"; @@ -122,10 +122,13 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. @@ -133,48 +136,67 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has filter expression to use in the report.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the report.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the report. Report can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping) })] + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of order by expression to use in the report.", SerializedName = @"sorting", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting) })] + System.Collections.Generic.List DataSetSorting { get; set; } /// If true, report includes monetary commitment. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If true, report includes monetary commitment.", SerializedName = @"includeMonetaryCommitment", PossibleTypes = new [] { typeof(bool) })] @@ -183,6 +205,9 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -191,6 +216,9 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -201,10 +229,14 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the report. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType Timeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string Timeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. @@ -212,6 +244,9 @@ public partial interface IReportConfigDefinition : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -226,33 +261,34 @@ public partial interface IReportConfigDefinitionInternal /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Has definition for data in this report config. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset DataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset DataSet { get; set; } /// /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// /// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } /// Has filter expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + System.Collections.Generic.List DataSetSorting { get; set; } /// If true, report includes monetary commitment. bool? IncludeMonetaryCommitment { get; set; } /// Has time period for pulling data for the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod TimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod TimePeriod { get; set; } /// The start date to pull data from. global::System.DateTime? TimePeriodFrom { get; set; } /// The end date to pull data to. @@ -260,7 +296,8 @@ public partial interface IReportConfigDefinitionInternal /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType Timeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string Timeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.json.cs index 0872dfd12355..2d1b6accabb9 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigDefinition(json) : null; } @@ -77,11 +77,11 @@ internal ReportConfigDefinition(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} - {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDataset.FromJson(__jsonDataSet) : DataSet;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)Timeframe;} - {_includeMonetaryCommitment = If( json?.PropertyT("includeMonetaryCommitment"), out var __jsonIncludeMonetaryCommitment) ? (bool?)__jsonIncludeMonetaryCommitment : IncludeMonetaryCommitment;} + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriod.FromJson(__jsonTimePeriod) : _timePeriod;} + {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDataset.FromJson(__jsonDataSet) : _dataSet;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_timeframe = If( json?.PropertyT("timeframe"), out var __jsonTimeframe) ? (string)__jsonTimeframe : (string)_timeframe;} + {_includeMonetaryCommitment = If( json?.PropertyT("includeMonetaryCommitment"), out var __jsonIncludeMonetaryCommitment) ? (bool?)__jsonIncludeMonetaryCommitment : _includeMonetaryCommitment;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.PowerShell.cs similarity index 59% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.PowerShell.cs index db528492b5d5..ee41acc1e057 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReportConfigFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigFilter(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal ReportConfigFilter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom)); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal ReportConfigFilter(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("And")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).And = (System.Collections.Generic.List) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom)); } if (content.Contains("Or")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Or = (System.Collections.Generic.List) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom)); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal ReportConfigFilter(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The filter expression to be used in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigFilterTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.TypeConverter.cs index 9e41b37472cb..e807ef08f8e0 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.cs similarity index 65% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.cs index fc9a143dc421..6c40be5863ff 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.cs @@ -3,43 +3,43 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The filter expression to be used in the report. public partial class ReportConfigFilter : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilterInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] _and; + private System.Collections.Generic.List _and; /// The logical "AND" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] And { get => this._and; set => this._and = value; } + public System.Collections.Generic.List And { get => this._and; set => this._and = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression _dimension; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression _dimension; /// Has comparison expression for a dimension [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression()); set => this._dimension = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression()); set => this._dimension = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] _or; + private System.Collections.Generic.List _or; /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] Or { get => this._or; set => this._or = value; } + public System.Collections.Generic.List Or { get => this._or; set => this._or = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression _tag; /// Has comparison expression for a tag [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression()); set => this._tag = value; } /// Creates an new instance. public ReportConfigFilter() @@ -55,34 +55,46 @@ public partial interface IReportConfigFilter : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""AND"" expression. Must have at least 2 items.", SerializedName = @"and", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] And { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + System.Collections.Generic.List And { get; set; } /// Has comparison expression for a dimension [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has comparison expression for a dimension", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Dimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Dimension { get; set; } /// The logical "OR" expression. Must have at least 2 items. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The logical ""OR"" expression. Must have at least 2 items.", SerializedName = @"or", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] Or { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + System.Collections.Generic.List Or { get; set; } /// Has comparison expression for a tag [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has comparison expression for a tag", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Tag { get; set; } } /// The filter expression to be used in the report. @@ -90,13 +102,13 @@ public partial interface IReportConfigFilterInternal { /// The logical "AND" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] And { get; set; } + System.Collections.Generic.List And { get; set; } /// Has comparison expression for a dimension - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Dimension { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Dimension { get; set; } /// The logical "OR" expression. Must have at least 2 items. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter[] Or { get; set; } + System.Collections.Generic.List Or { get; set; } /// Has comparison expression for a tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigComparisonExpression Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigComparisonExpression Tag { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.json.cs similarity index 86% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.json.cs index 8bdc0e079ce2..19b7a1d36b37 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigFilter.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigFilter(json) : null; } @@ -77,10 +77,10 @@ internal ReportConfigFilter(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Ru { return; } - {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilter.FromJson(__u) )) ))() : null : And;} - {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigFilter.FromJson(__p) )) ))() : null : Or;} - {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression.FromJson(__jsonDimensions) : Dimension;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilter.FromJson(__u) )) ))() : null : _and;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilter.FromJson(__p) )) ))() : null : _or;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression.FromJson(__jsonDimensions) : _dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigComparisonExpression.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.PowerShell.cs index c47808ff4d8a..ebad8a7d789a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ReportConfigGrouping partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigGrouping(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigGrouping(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ReportConfigGrouping(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal ReportConfigGrouping(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ReportConfigGrouping(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The group by expression to be used in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigGroupingTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.TypeConverter.cs index f81cfd3b2fb9..ff5301bb2c77 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.cs index 4f7c6c97e9e5..90e141c171b1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The group by expression to be used in the report. public partial class ReportConfigGrouping : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGroupingInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGroupingInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class ReportConfigGrouping : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType _type; + private string _type; /// Has type of the column to group. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public ReportConfigGrouping() @@ -45,6 +45,9 @@ public partial interface IReportConfigGrouping : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to group. This version supports subscription lowest possible grain.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -53,10 +56,14 @@ public partial interface IReportConfigGrouping : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has type of the column to group.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Tag", "Dimension")] + string Type { get; set; } } /// The group by expression to be used in the report. @@ -68,7 +75,8 @@ public partial interface IReportConfigGroupingInternal /// string Name { get; set; } /// Has type of the column to group. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Tag", "Dimension")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.json.cs index 01c805b24e90..30a9fa935e47 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigGrouping.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigGrouping partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigGrouping(json) : null; } @@ -77,8 +77,8 @@ internal ReportConfigGrouping(Microsoft.Azure.PowerShell.Cmdlets.CostManagement. { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.PowerShell.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.PowerShell.cs index 0d9e1058cc82..692424571797 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReportConfigSorting partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigSorting(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigSorting(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ReportConfigSorting(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal ReportConfigSorting(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ReportConfigSorting(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The order by expression to be used in the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigSortingTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.TypeConverter.cs index e9426b016104..9c3fd824d27c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.cs similarity index 78% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.cs index 035c310b39fb..48a468c56b6b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The order by expression to be used in the report. public partial class ReportConfigSorting : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSortingInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSortingInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType? _direction; + private string _direction; /// Direction of sort. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType? Direction { get => this._direction; set => this._direction = value; } + public string Direction { get => this._direction; set => this._direction = value; } /// Backing field for property. private string _name; @@ -41,14 +41,21 @@ public partial interface IReportConfigSorting : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Direction of sort.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType? Direction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Ascending", "Descending")] + string Direction { get; set; } /// The name of the column to sort. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the column to sort.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -60,7 +67,8 @@ public partial interface IReportConfigSortingInternal { /// Direction of sort. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType? Direction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Ascending", "Descending")] + string Direction { get; set; } /// The name of the column to sort. string Name { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.json.cs index 1ecfe72b3856..066f1f9b0faf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigSorting.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigSorting.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigSorting partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigSorting(json) : null; } @@ -77,8 +77,8 @@ internal ReportConfigSorting(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.R { return; } - {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)Direction;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)_direction;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.PowerShell.cs similarity index 70% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.PowerShell.cs index 3a5712e45be1..cd1df627afbd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ReportConfigTimePeriod partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportConfigTimePeriod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportConfigTimePeriod(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ReportConfigTimePeriod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal ReportConfigTimePeriod(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("From")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).From, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("To")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal)this).To, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ReportConfigTimePeriod(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The start and end date for pulling data for the report. [System.ComponentModel.TypeConverter(typeof(ReportConfigTimePeriodTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.TypeConverter.cs index 6001f94201aa..e52f6fb0916c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.cs index 72eed2caad7c..130de67ba3bb 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The start and end date for pulling data for the report. public partial class ReportConfigTimePeriod : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriodInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriodInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IReportConfigTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -49,6 +52,9 @@ public partial interface IReportConfigTimePeriod : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.json.cs index 9d4e7f64a2b2..0022c7d9db3d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportConfigTimePeriod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportConfigTimePeriod partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportConfigTimePeriod(json) : null; } @@ -77,8 +77,8 @@ internal ReportConfigTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.CostManagemen { return; } - {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : From : From;} - {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : To : To;} + {_from = If( json?.PropertyT("from"), out var __jsonFrom) ? global::System.DateTime.TryParse((string)__jsonFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFromValue) ? __jsonFromValue : _from : _from;} + {_to = If( json?.PropertyT("to"), out var __jsonTo) ? global::System.DateTime.TryParse((string)__jsonTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonToValue) ? __jsonToValue : _to : _to;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.PowerShell.cs new file mode 100644 index 000000000000..747349337982 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.PowerShell.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The manifest of the report generated by the operation. + [System.ComponentModel.TypeConverter(typeof(ReportManifestTypeConverter))] + public partial class ReportManifest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportManifest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportManifest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportManifest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).DataFormat = (string) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).DataFormat, global::System.Convert.ToString); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).Blob = (System.Collections.Generic.List) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyMetric, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodEnd, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportManifest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestContext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).DataFormat = (string) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).DataFormat, global::System.Convert.ToString); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).Blob = (System.Collections.Generic.List) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyMetric, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal)this).TimePeriodEnd, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The manifest of the report generated by the operation. + [System.ComponentModel.TypeConverter(typeof(ReportManifestTypeConverter))] + public partial interface IReportManifest + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.TypeConverter.cs index 0139f7a33079..5343088af6bd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.cs index c2300667e818..4dfa778fc1ba 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The manifest of the report generated by the operation. public partial class ReportManifest : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] _blob; + private System.Collections.Generic.List _blob; /// List of blob information generated by this operation. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] Blob { get => this._blob; set => this._blob = value; } + public System.Collections.Generic.List Blob { get => this._blob; set => this._blob = value; } /// Backing field for property. private int? _blobCount; @@ -42,11 +42,11 @@ public partial class ReportManifest : public bool? CompressData { get => this._compressData; set => this._compressData = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? _dataFormat; + private string _dataFormat; /// The data format of the report [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? DataFormat { get => this._dataFormat; set => this._dataFormat = value; } + public string DataFormat { get => this._dataFormat; set => this._dataFormat = value; } /// Backing field for property. private string _manifestVersion; @@ -56,13 +56,13 @@ public partial class ReportManifest : public string ManifestVersion { get => this._manifestVersion; set => this._manifestVersion = value; } /// Internal Acessors for RequestBodyTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyTimePeriod = value; } /// Internal Acessors for RequestContext - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal.RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContext()); set { {_requestContext = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal.RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContext()); set { {_requestContext = value;} } } /// Internal Acessors for RequestContextRequestBody - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifestInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBody = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifestInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBody = value; } /// /// This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter @@ -70,7 +70,7 @@ public partial class ReportManifest : /// is not provided in the request body the API will return the current month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyBillingPeriod = value ?? null; } + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyBillingPeriod = value ?? null; } /// /// This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing @@ -79,30 +79,30 @@ public partial class ReportManifest : /// month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyInvoiceId = value ?? null; } + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyInvoiceId = value ?? null; } /// The type of the detailed report. By default ActualCost is provided [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyMetric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType)""); } + public string RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestBodyMetric = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext _requestContext; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext _requestContext; /// The context of the Cost Details request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContext()); set => this._requestContext = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContext()); set => this._requestContext = value; } /// The request scope of the request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).RequestScope = value ?? null; } + public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).RequestScope = value ?? null; } /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodEnd = value ?? null; } + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).TimePeriodEnd = value ?? null; } /// The start date to pull data from. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodStart = value ?? null; } + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)RequestContext).TimePeriodStart = value ?? null; } /// Creates an new instance. public ReportManifest() @@ -118,14 +118,20 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of blob information generated by this operation.", SerializedName = @"blobs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] Blob { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo) })] + System.Collections.Generic.List Blob { get; set; } /// The total number of blobs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total number of blobs.", SerializedName = @"blobCount", PossibleTypes = new [] { typeof(int) })] @@ -134,6 +140,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total number of bytes in all blobs.", SerializedName = @"byteCount", PossibleTypes = new [] { typeof(long) })] @@ -142,6 +151,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Is the data in compressed format.", SerializedName = @"compressData", PossibleTypes = new [] { typeof(bool) })] @@ -150,14 +162,21 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The data format of the report", SerializedName = @"dataFormat", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? DataFormat { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string DataFormat { get; set; } /// The Manifest version. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Manifest version.", SerializedName = @"manifestVersion", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +189,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"billingPeriod", PossibleTypes = new [] { typeof(string) })] @@ -183,6 +205,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"invoiceId", PossibleTypes = new [] { typeof(string) })] @@ -191,14 +216,21 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the detailed report. By default ActualCost is provided", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// The request scope of the request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The request scope of the request.", SerializedName = @"requestScope", PossibleTypes = new [] { typeof(string) })] @@ -207,6 +239,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to. example format 2020-03-15", SerializedName = @"end", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +250,9 @@ public partial interface IReportManifest : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from. example format 2020-03-15", SerializedName = @"start", PossibleTypes = new [] { typeof(string) })] @@ -226,7 +264,7 @@ public partial interface IReportManifestInternal { /// List of blob information generated by this operation. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo[] Blob { get; set; } + System.Collections.Generic.List Blob { get; set; } /// The total number of blobs. int? BlobCount { get; set; } /// The total number of bytes in all blobs. @@ -234,7 +272,8 @@ public partial interface IReportManifestInternal /// Is the data in compressed format. bool? CompressData { get; set; } /// The data format of the report - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat? DataFormat { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + string DataFormat { get; set; } /// The Manifest version. string ManifestVersion { get; set; } /// @@ -251,18 +290,19 @@ public partial interface IReportManifestInternal /// string RequestBodyInvoiceId { get; set; } /// The type of the detailed report. By default ActualCost is provided - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// /// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId /// or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body /// the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than /// 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } /// The context of the Cost Details request. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext RequestContext { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext RequestContext { get; set; } /// The request payload body provided in Cost Details call - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition RequestContextRequestBody { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition RequestContextRequestBody { get; set; } /// The request scope of the request. string RequestContextRequestScope { get; set; } /// The end date to pull data to. example format 2020-03-15 diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.json.cs similarity index 90% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.json.cs index 94ed4ce68ebd..79fc7969ce7e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/ReportManifest.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportManifest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportManifest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IReportManifest FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportManifest FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportManifest(json) : null; } @@ -77,13 +77,13 @@ internal ReportManifest(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_requestContext = If( json?.PropertyT("requestContext"), out var __jsonRequestContext) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.RequestContext.FromJson(__jsonRequestContext) : RequestContext;} - {_manifestVersion = If( json?.PropertyT("manifestVersion"), out var __jsonManifestVersion) ? (string)__jsonManifestVersion : (string)ManifestVersion;} - {_dataFormat = If( json?.PropertyT("dataFormat"), out var __jsonDataFormat) ? (string)__jsonDataFormat : (string)DataFormat;} - {_byteCount = If( json?.PropertyT("byteCount"), out var __jsonByteCount) ? (long?)__jsonByteCount : ByteCount;} - {_blobCount = If( json?.PropertyT("blobCount"), out var __jsonBlobCount) ? (int?)__jsonBlobCount : BlobCount;} - {_compressData = If( json?.PropertyT("compressData"), out var __jsonCompressData) ? (bool?)__jsonCompressData : CompressData;} - {_blob = If( json?.PropertyT("blobs"), out var __jsonBlobs) ? If( __jsonBlobs as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IBlobInfo) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.BlobInfo.FromJson(__u) )) ))() : null : Blob;} + {_requestContext = If( json?.PropertyT("requestContext"), out var __jsonRequestContext) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.RequestContext.FromJson(__jsonRequestContext) : _requestContext;} + {_manifestVersion = If( json?.PropertyT("manifestVersion"), out var __jsonManifestVersion) ? (string)__jsonManifestVersion : (string)_manifestVersion;} + {_dataFormat = If( json?.PropertyT("dataFormat"), out var __jsonDataFormat) ? (string)__jsonDataFormat : (string)_dataFormat;} + {_byteCount = If( json?.PropertyT("byteCount"), out var __jsonByteCount) ? (long?)__jsonByteCount : _byteCount;} + {_blobCount = If( json?.PropertyT("blobCount"), out var __jsonBlobCount) ? (int?)__jsonBlobCount : _blobCount;} + {_compressData = If( json?.PropertyT("compressData"), out var __jsonCompressData) ? (bool?)__jsonCompressData : _compressData;} + {_blob = If( json?.PropertyT("blobs"), out var __jsonBlobs) ? If( __jsonBlobs as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IBlobInfo) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.BlobInfo.FromJson(__u) )) ))() : null : _blob;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.PowerShell.cs similarity index 72% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.PowerShell.cs index 0b59974587f3..d97a62d07474 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReportUrl partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReportUrl(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReportUrl(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ReportUrl(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ReportUrl1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ReportUrl1 = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ReportUrl1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ReportUrl1 = (string) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ReportUrl1, global::System.Convert.ToString); } if (content.Contains("ValidUntil")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal ReportUrl(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ReportUrl1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ReportUrl1 = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ReportUrl1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ReportUrl1 = (string) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ReportUrl1, global::System.Convert.ToString); } if (content.Contains("ValidUntil")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal)this).ValidUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ReportUrl(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The URL to download the generated report. [System.ComponentModel.TypeConverter(typeof(ReportUrlTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.TypeConverter.cs index 29fb96566f1a..e6dec7091555 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.cs similarity index 76% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.cs index 35a21729f510..4d9b7db9d645 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.cs @@ -3,24 +3,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The URL to download the generated report. public partial class ReportUrl : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrlInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrlInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? _reportUrl1; + private string _reportUrl1; /// /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl1 { get => this._reportUrl1; set => this._reportUrl1 = value; } + public string ReportUrl1 { get => this._reportUrl1; set => this._reportUrl1 = value; } /// Backing field for property. private global::System.DateTime? _validUntil; @@ -45,14 +45,21 @@ public partial interface IReportUrl : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity", SerializedName = @"reportUrl", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl1 { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("InstanceFlexibilityGroup", "InstanceFlexibilityRatio", "InstanceId", "Kind", "ReservationId", "ReservationOrderId", "ReservedHours", "SkuName", "TotalReservedQuantity", "UsageDate", "UsedHours")] + string ReportUrl1 { get; set; } /// The time at which report URL becomes invalid. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time at which report URL becomes invalid.", SerializedName = @"validUntil", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,7 +73,8 @@ public partial interface IReportUrlInternal /// /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema? ReportUrl1 { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("InstanceFlexibilityGroup", "InstanceFlexibilityRatio", "InstanceId", "Kind", "ReservationId", "ReservationOrderId", "ReservedHours", "SkuName", "TotalReservedQuantity", "UsageDate", "UsedHours")] + string ReportUrl1 { get; set; } /// The time at which report URL becomes invalid. global::System.DateTime? ValidUntil { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.json.cs similarity index 95% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.json.cs index e92467413488..6a34eaf4808f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ReportUrl.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ReportUrl.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReportUrl partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportUrl FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportUrl FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ReportUrl(json) : null; } @@ -77,8 +77,8 @@ internal ReportUrl(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Jso { return; } - {_reportUrl1 = If( json?.PropertyT("reportUrl"), out var __jsonReportUrl) ? (string)__jsonReportUrl : (string)ReportUrl1;} - {_validUntil = If( json?.PropertyT("validUntil"), out var __jsonValidUntil) ? global::System.DateTime.TryParse((string)__jsonValidUntil, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidUntilValue) ? __jsonValidUntilValue : ValidUntil : ValidUntil;} + {_reportUrl1 = If( json?.PropertyT("reportUrl"), out var __jsonReportUrl) ? (string)__jsonReportUrl : (string)_reportUrl1;} + {_validUntil = If( json?.PropertyT("validUntil"), out var __jsonValidUntil) ? global::System.DateTime.TryParse((string)__jsonValidUntil, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidUntilValue) ? __jsonValidUntilValue : _validUntil : _validUntil;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.PowerShell.cs similarity index 58% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.PowerShell.cs index 4a50b0cd0970..257a81f49014 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class RequestContext partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RequestContext(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RequestContext(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202205 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,41 +111,41 @@ internal RequestContext(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RequestBody")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); } if (content.Contains("RequestScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); } if (content.Contains("RequestBodyTimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("RequestBodyMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyMetric, global::System.Convert.ToString); } if (content.Contains("RequestBodyBillingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); } if (content.Contains("RequestBodyInvoiceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); } if (content.Contains("TimePeriodStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); } if (content.Contains("TimePeriodEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodEnd, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,35 +160,35 @@ internal RequestContext(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("RequestBody")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); } if (content.Contains("RequestScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); } if (content.Contains("RequestBodyTimePeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.CostDetailsTimePeriodTypeConverter.ConvertFrom); } if (content.Contains("RequestBodyMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyMetric = (string) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyMetric, global::System.Convert.ToString); } if (content.Contains("RequestBodyBillingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); } if (content.Contains("RequestBodyInvoiceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); } if (content.Contains("TimePeriodStart")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); } if (content.Contains("TimePeriodEnd")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal)this).TimePeriodEnd, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -189,6 +197,18 @@ internal RequestContext(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The context of the Cost Details request. [System.ComponentModel.TypeConverter(typeof(RequestContextTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.TypeConverter.cs index a62ea4458450..fb2a7946f1d6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.cs similarity index 74% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.cs index ede69356d7ee..867e7192bfb1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The context of the Cost Details request. public partial class RequestContext : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal { /// Internal Acessors for RequestBody - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal.RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition()); set { {_requestBody = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal.RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition()); set { {_requestBody = value;} } } /// Internal Acessors for RequestBodyTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContextInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContextInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition _requestBody; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition _requestBody; /// The request payload body provided in Cost Details call [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition()); set => this._requestBody = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition()); set => this._requestBody = value; } /// /// This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter @@ -32,7 +32,7 @@ public partial class RequestContext : /// is not provided in the request body the API will return the current month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).BillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).BillingPeriod = value ?? null; } + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).BillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).BillingPeriod = value ?? null; } /// /// This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing @@ -41,11 +41,11 @@ public partial class RequestContext : /// month's cost. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId = value ?? null; } + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId = value ?? null; } /// The type of the detailed report. By default ActualCost is provided [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType)""); } + public string RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric = value ?? null; } /// Backing field for property. private string _requestScope; @@ -56,11 +56,11 @@ public partial class RequestContext : /// The end date to pull data to. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd = value ?? null; } + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd = value ?? null; } /// The start date to pull data from. example format 2020-03-15 [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart = value ?? null; } + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart = value ?? null; } /// Creates an new instance. public RequestContext() @@ -80,6 +80,9 @@ public partial interface IRequestContext : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"billingPeriod", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +96,9 @@ public partial interface IRequestContext : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost.", SerializedName = @"invoiceId", PossibleTypes = new [] { typeof(string) })] @@ -101,14 +107,21 @@ public partial interface IRequestContext : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the detailed report. By default ActualCost is provided", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// The request scope of the request. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The request scope of the request.", SerializedName = @"requestScope", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +130,9 @@ public partial interface IRequestContext : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to. example format 2020-03-15", SerializedName = @"end", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +141,9 @@ public partial interface IRequestContext : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from. example format 2020-03-15", SerializedName = @"start", PossibleTypes = new [] { typeof(string) })] @@ -136,7 +155,7 @@ public partial interface IRequestContextInternal { /// The request payload body provided in Cost Details call - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition RequestBody { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition RequestBody { get; set; } /// /// This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter /// cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter @@ -151,14 +170,15 @@ public partial interface IRequestContextInternal /// string RequestBodyInvoiceId { get; set; } /// The type of the detailed report. By default ActualCost is provided - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + string RequestBodyMetric { get; set; } /// /// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId /// or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body /// the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than /// 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } /// The request scope of the request. string RequestScope { get; set; } /// The end date to pull data to. example format 2020-03-15 diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.json.cs similarity index 94% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.json.cs index bad974987827..fb6013554bcf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20220501/RequestContext.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/RequestContext.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RequestContext partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IRequestContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IRequestContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new RequestContext(json) : null; } @@ -77,8 +77,8 @@ internal RequestContext(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_requestBody = If( json?.PropertyT("requestBody"), out var __jsonRequestBody) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition.FromJson(__jsonRequestBody) : RequestBody;} - {_requestScope = If( json?.PropertyT("requestScope"), out var __jsonRequestScope) ? (string)__jsonRequestScope : (string)RequestScope;} + {_requestBody = If( json?.PropertyT("requestBody"), out var __jsonRequestBody) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition.FromJson(__jsonRequestBody) : _requestBody;} + {_requestScope = If( json?.PropertyT("requestScope"), out var __jsonRequestScope) ? (string)__jsonRequestScope : (string)_requestScope;} AfterFromJson(json); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 64% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.PowerShell.cs index 725c51747864..057f76bd717d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Resource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,37 +111,37 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,31 +156,31 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Sku, global::System.Convert.ToString); } if (content.Contains("ETag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).ETag, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal Resource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The Resource model definition. [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.TypeConverter.cs index 5e61a21bfffd..fb615a0f4d22 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.cs similarity index 83% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.cs index 7c992ae420a8..f5a61d10df5a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The Resource model definition. public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal { /// Backing field for property. @@ -35,25 +35,25 @@ public partial class Resource : public string Location { get => this._location; } /// Internal Acessors for ETag - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.ETag { get => this._eTag; set { {_eTag = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Location - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Location { get => this._location; set { {_location = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Location { get => this._location; set { {_location = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Sku - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Sku { get => this._sku; set { {_sku = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Sku { get => this._sku; set { {_sku = value;} } } /// Internal Acessors for Tag - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags()); set { {_tag = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags()); set { {_tag = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -70,11 +70,11 @@ public partial class Resource : public string Sku { get => this._sku; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags()); } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags()); } /// Backing field for property. private string _type; @@ -97,6 +97,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ETag of the resource.", SerializedName = @"eTag", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +119,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Location of the resource.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +130,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +141,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SKU of the resource.", SerializedName = @"sku", PossibleTypes = new [] { typeof(string) })] @@ -137,14 +152,20 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -166,7 +187,7 @@ public partial interface IResourceInternal /// SKU of the resource. string Sku { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags Tag { get; set; } /// Resource type. string Type { get; set; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.json.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.json.cs index 0fbc95799832..14f612c8033e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/Resource.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Resource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -77,13 +77,13 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? (string)__jsonSku : (string)Sku;} - {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags.FromJson(__jsonTags) : Tag;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? (string)__jsonSku : (string)_sku;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)_eTag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } @@ -106,31 +106,31 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._sku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._sku.ToString()) : null, "sku" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.PowerShell.cs similarity index 81% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.PowerShell.cs index 7253d08b191d..1145ebd98eab 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ResourceTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,7 +115,7 @@ internal ResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,6 +137,18 @@ internal ResourceTags(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Resource tags. [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs index 5722d65d3cba..4e7d696ab8bd 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.cs similarity index 93% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.cs index baad5ff2f59b..688824ebcf8a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Resource tags. public partial class ResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTagsInternal { /// Creates an new instance. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.dictionary.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.dictionary.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.dictionary.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.dictionary.cs index 0303907fdff0..b5aa1ff05153 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.dictionary.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.json.cs similarity index 96% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.json.cs index a7b093b825a5..1aa8ec153119 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ResourceTags.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.PowerShell.cs new file mode 100644 index 000000000000..5f7059b04244 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.PowerShell.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// States and configurations of Cost Analysis. + [System.ComponentModel.TypeConverter(typeof(ViewTypeConverter))] + public partial class View + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new View(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new View(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal View(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ModifiedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DateRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Chart = (string) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Chart, global::System.Convert.ToString); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Accumulated = (string) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Accumulated, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Metric, global::System.Convert.ToString); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Kpi = (System.Collections.Generic.List) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Pivot = (System.Collections.Generic.List) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("QueryTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("QueryDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("QueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryType, global::System.Convert.ToString); + } + if (content.Contains("QueryTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimeframe = (string) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimeframe, global::System.Convert.ToString); + } + if (content.Contains("QueryIncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal View(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ModifiedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DateRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Chart = (string) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Chart, global::System.Convert.ToString); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Accumulated = (string) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Accumulated, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Metric, global::System.Convert.ToString); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Kpi = (System.Collections.Generic.List) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Pivot = (System.Collections.Generic.List) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("QueryTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("QueryDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("QueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryType, global::System.Convert.ToString); + } + if (content.Contains("QueryTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimeframe = (string) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryTimeframe, global::System.Convert.ToString); + } + if (content.Contains("QueryIncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// States and configurations of Cost Analysis. + [System.ComponentModel.TypeConverter(typeof(ViewTypeConverter))] + public partial interface IView + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.TypeConverter.cs similarity index 98% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.TypeConverter.cs index 9db191711a73..3754a9302ffe 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.cs similarity index 64% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.cs index b3ddfa862719..0f05e303343d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.cs @@ -3,171 +3,175 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// States and configurations of Cost Analysis. public partial class View : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(); /// Show costs accumulated over time. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Accumulated; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Accumulated = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType)""); } + public string Accumulated { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Accumulated; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Accumulated = value ?? null; } /// Chart type of the main view in Cost Analysis. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Chart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Chart = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType)""); } + public string Chart { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Chart; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Chart = value ?? null; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } /// Date the user created this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn; } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).CreatedOn; } /// Currency of the current view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Currency; } + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Currency; } /// /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetAggregation = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetAggregation = value ?? null /* model class */; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetFilter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetFilter = value ?? null /* model class */; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetGranularity = value ?? null; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetGrouping = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetGrouping = value ?? null /* arrayOf */; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetSorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetSorting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetSorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetSorting = value ?? null /* arrayOf */; } /// Date range of the current view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DateRange; } + public string DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DateRange; } /// User input name of the view. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DisplayName = value ?? null; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } /// Resource Id. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; } /// List of KPIs to show in Cost Analysis UI. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Kpi; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Kpi = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Kpi { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Kpi; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Kpi = value ?? null /* arrayOf */; } /// Metric to use when displaying costs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Metric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType)""); } + public string Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Metric = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).CreatedOn = value; } /// Internal Acessors for Currency - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Currency = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Currency = value; } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DataSetConfiguration = value; } /// Internal Acessors for DateRange - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DateRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).DateRange = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DateRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).DateRange = value; } /// Internal Acessors for ModifiedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).ModifiedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).ModifiedOn = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewProperties()); set { {_property = value;} } } /// Internal Acessors for Query - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.Query { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Query = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.Query { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Query = value; } /// Internal Acessors for QueryDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.QueryDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryDataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.QueryDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryDataSet = value; } /// Internal Acessors for QueryTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.QueryTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryTimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.QueryTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryTimePeriod = value; } /// Internal Acessors for QueryType - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewInternal.QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewInternal.QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryType = value; } /// Date when the user last modified this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn; } + public global::System.DateTime? ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).ModifiedOn; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Name; } /// Configuration of 3 sub-views in the Cost Analysis UI. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Pivot; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Pivot = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Pivot { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Pivot; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Pivot = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties _property; /// The properties of the view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewProperties()); set => this._property = value; } /// If true, report includes monetary commitment. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? QueryIncludeMonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryIncludeMonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryIncludeMonetaryCommitment = value ?? default(bool); } + public bool? QueryIncludeMonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryIncludeMonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryIncludeMonetaryCommitment = value ?? default(bool); } /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType)""); } + public string QueryTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryTimeframe = value ?? null; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).QueryType; } + public string QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).QueryType; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -181,19 +185,19 @@ public partial class View : /// scope. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).Scope = value ?? null; } /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date to pull data to. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -216,24 +220,32 @@ public View() /// States and configurations of Cost Analysis. public partial interface IView : Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResource + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResource { /// Show costs accumulated over time. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Show costs accumulated over time.", SerializedName = @"accumulated", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("true", "false")] + string Accumulated { get; set; } /// Chart type of the main view in Cost Analysis. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Chart type of the main view in Cost Analysis. Required.", SerializedName = @"chart", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Area", "Line", "StackedColumn", "GroupedColumn", "Table")] + string Chart { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. @@ -241,14 +253,20 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Date the user created this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date the user created this view.", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -257,6 +275,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Currency of the current view.", SerializedName = @"currency", PossibleTypes = new [] { typeof(string) })] @@ -268,48 +289,67 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has filter expression to use in the report.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the report.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the report. Report can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping) })] + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of order by expression to use in the report.", SerializedName = @"sorting", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting) })] + System.Collections.Generic.List DataSetSorting { get; set; } /// Date range of the current view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date range of the current view.", SerializedName = @"dateRange", PossibleTypes = new [] { typeof(string) })] @@ -318,6 +358,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User input name of the view. Required.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -326,22 +369,32 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of KPIs to show in Cost Analysis UI.", SerializedName = @"kpis", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties) })] + System.Collections.Generic.List Kpi { get; set; } /// Metric to use when displaying costs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Metric to use when displaying costs.", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost", "AHUB")] + string Metric { get; set; } /// Date when the user last modified this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date when the user last modified this view.", SerializedName = @"modifiedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -350,14 +403,20 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", SerializedName = @"pivots", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties) })] + System.Collections.Generic.List Pivot { get; set; } /// If true, report includes monetary commitment. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If true, report includes monetary commitment.", SerializedName = @"includeMonetaryCommitment", PossibleTypes = new [] { typeof(bool) })] @@ -368,10 +427,14 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the report. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string QueryTimeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. @@ -379,6 +442,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -397,6 +463,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Cost Management scope to save the view on. 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 ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -405,6 +474,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -413,6 +485,9 @@ public partial interface IView : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -421,17 +496,19 @@ public partial interface IView : } /// States and configurations of Cost Analysis. public partial interface IViewInternal : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IProxyResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IProxyResourceInternal { /// Show costs accumulated over time. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("true", "false")] + string Accumulated { get; set; } /// Chart type of the main view in Cost Analysis. Required. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Area", "Line", "StackedColumn", "GroupedColumn", "Table")] + string Chart { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Date the user created this view. global::System.DateTime? CreatedOn { get; set; } /// Currency of the current view. @@ -440,48 +517,51 @@ public partial interface IViewInternal : /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// /// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } /// Has filter expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + System.Collections.Generic.List DataSetSorting { get; set; } /// Date range of the current view. string DateRange { get; set; } /// User input name of the view. Required. string DisplayName { get; set; } /// List of KPIs to show in Cost Analysis UI. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + System.Collections.Generic.List Kpi { get; set; } /// Metric to use when displaying costs. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost", "AHUB")] + string Metric { get; set; } /// Date when the user last modified this view. global::System.DateTime? ModifiedOn { get; set; } /// Configuration of 3 sub-views in the Cost Analysis UI. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + System.Collections.Generic.List Pivot { get; set; } /// The properties of the view. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties Property { get; set; } /// Query body configuration. Required. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition Query { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition Query { get; set; } /// Has definition for data in this report config. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset QueryDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset QueryDataSet { get; set; } /// If true, report includes monetary commitment. bool? QueryIncludeMonetaryCommitment { get; set; } /// Has time period for pulling data for the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod QueryTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod QueryTimePeriod { get; set; } /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string QueryTimeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.json.cs similarity index 92% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.json.cs index ef486227791c..1e647314b0f2 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/View.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/View.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class View partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new View(json) : null; } @@ -102,8 +100,8 @@ internal View(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.Jso { return; } - __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ProxyResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.PowerShell.cs similarity index 71% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.PowerShell.cs index 9922107869c5..befd81ec2c87 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ViewListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ViewListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ViewListResult(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api202110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +128,17 @@ internal ViewListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +153,11 @@ internal ViewListResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ViewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ViewTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.TypeConverter.cs index 524f589e7d92..5972c9425e18 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.cs similarity index 73% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.cs index a500f1217c80..6d70d2d900cf 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// Result of listing views. It contains a list of available views. public partial class ViewListResult : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[] Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ViewListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[] _value; + private System.Collections.Generic.List _value; /// The list of views. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ViewListResult() @@ -47,6 +47,9 @@ public partial interface IViewListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IViewListResult : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of views.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView) })] + System.Collections.Generic.List Value { get; } } /// Result of listing views. It contains a list of available views. @@ -68,7 +74,7 @@ public partial interface IViewListResultInternal /// The link (url) to the next page of results. string NextLink { get; set; } /// The list of views. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.json.cs similarity index 91% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.json.cs index 07a0cba6b640..bd91beba995f 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewListResult.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ViewListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ViewListResult(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal ViewListResult(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IView) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.View.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IView) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.View.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.PowerShell.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.PowerShell.cs new file mode 100644 index 000000000000..f2facc597a16 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.PowerShell.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + + /// The properties of the view. + [System.ComponentModel.TypeConverter(typeof(ViewPropertiesTypeConverter))] + public partial class ViewProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ViewProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ViewProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ViewProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ModifiedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DateRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Chart = (string) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Chart, global::System.Convert.ToString); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Accumulated = (string) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Accumulated, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Metric, global::System.Convert.ToString); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Kpi = (System.Collections.Generic.List) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Pivot = (System.Collections.Generic.List) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("QueryTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("QueryDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("QueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryType, global::System.Convert.ToString); + } + if (content.Contains("QueryTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimeframe = (string) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimeframe, global::System.Convert.ToString); + } + if (content.Contains("QueryIncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ViewProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ModifiedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ModifiedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DateRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Chart = (string) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Chart, global::System.Convert.ToString); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Accumulated = (string) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Accumulated, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Metric = (string) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Metric, global::System.Convert.ToString); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Kpi = (System.Collections.Generic.List) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Pivot = (System.Collections.Generic.List) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("QueryTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod) content.GetValueForProperty("QueryTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("QueryDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryDataSet = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset) content.GetValueForProperty("QueryDataSet",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryDataSet, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("QueryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryType = (string) content.GetValueForProperty("QueryType",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryType, global::System.Convert.ToString); + } + if (content.Contains("QueryTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimeframe = (string) content.GetValueForProperty("QueryTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryTimeframe, global::System.Convert.ToString); + } + if (content.Contains("QueryIncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment = (bool?) content.GetValueForProperty("QueryIncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).QueryIncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime?) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodTo = (global::System.DateTime?) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).TimePeriodTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGranularity = (string) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGranularity, global::System.Convert.ToString); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGrouping = (System.Collections.Generic.List) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetSorting = (System.Collections.Generic.List) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ConfigurationColumn = (System.Collections.Generic.List) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// The properties of the view. + [System.ComponentModel.TypeConverter(typeof(ViewPropertiesTypeConverter))] + public partial interface IViewProperties + + { + + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.TypeConverter.cs similarity index 97% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.TypeConverter.cs index 90d4cb3a5a6c..873cc9c2e595 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.cs similarity index 69% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.cs index a76620460a34..748500608334 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.cs @@ -3,36 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; /// The properties of the view. public partial class ViewProperties : - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? _accumulated; + private string _accumulated; /// Show costs accumulated over time. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get => this._accumulated; set => this._accumulated = value; } + public string Accumulated { get => this._accumulated; set => this._accumulated = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? _chart; + private string _chart; /// Chart type of the main view in Cost Analysis. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get => this._chart; set => this._chart = value; } + public string Chart { get => this._chart; set => this._chart = value; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).ConfigurationColumn = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).ConfigurationColumn = value ?? null /* arrayOf */; } /// Backing field for property. private global::System.DateTime? _createdOn; @@ -53,25 +53,25 @@ public partial class ViewProperties : /// aggregated column. Report can have up to 2 aggregation clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetAggregation = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetAggregation = value ?? null /* model class */; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetFilter = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetFilter = value ?? null /* model class */; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType)""); } + public string DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetGranularity = value ?? null; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetGrouping = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetGrouping = value ?? null /* arrayOf */; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetSorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetSorting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetSorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetSorting = value ?? null /* arrayOf */; } /// Backing field for property. private string _dateRange; @@ -88,45 +88,45 @@ public partial class ViewProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] _kpi; + private System.Collections.Generic.List _kpi; /// List of KPIs to show in Cost Analysis UI. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get => this._kpi; set => this._kpi = value; } + public System.Collections.Generic.List Kpi { get => this._kpi; set => this._kpi = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? _metric; + private string _metric; /// Metric to use when displaying costs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get => this._metric; set => this._metric = value; } + public string Metric { get => this._metric; set => this._metric = value; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } /// Internal Acessors for Currency - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } /// Internal Acessors for DataSetConfiguration - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSetConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSetConfiguration = value; } /// Internal Acessors for DateRange - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.DateRange { get => this._dateRange; set { {_dateRange = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.DateRange { get => this._dateRange; set { {_dateRange = value;} } } /// Internal Acessors for ModifiedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.ModifiedOn { get => this._modifiedOn; set { {_modifiedOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.ModifiedOn { get => this._modifiedOn; set { {_modifiedOn = value;} } } /// Internal Acessors for Query - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinition()); set { {_query = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinition()); set { {_query = value;} } } /// Internal Acessors for QueryDataSet - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.QueryDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).DataSet = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.QueryDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).DataSet = value; } /// Internal Acessors for QueryTimePeriod - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.QueryTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriod = value; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.QueryTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriod = value; } /// Internal Acessors for QueryType - string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewPropertiesInternal.QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewPropertiesInternal.QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).Type = value; } /// Backing field for property. private global::System.DateTime? _modifiedOn; @@ -136,35 +136,35 @@ public partial class ViewProperties : public global::System.DateTime? ModifiedOn { get => this._modifiedOn; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] _pivot; + private System.Collections.Generic.List _pivot; /// Configuration of 3 sub-views in the Cost Analysis UI. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get => this._pivot; set => this._pivot = value; } + public System.Collections.Generic.List Pivot { get => this._pivot; set => this._pivot = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition _query; + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition _query; /// Query body configuration. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinition()); set => this._query = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinition()); set => this._query = value; } /// If true, report includes monetary commitment. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public bool? QueryIncludeMonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).IncludeMonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).IncludeMonetaryCommitment = value ?? default(bool); } + public bool? QueryIncludeMonetaryCommitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).IncludeMonetaryCommitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).IncludeMonetaryCommitment = value ?? default(bool); } /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).Timeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).Timeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType)""); } + public string QueryTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).Timeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).Timeframe = value ?? null; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public string QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).Type; } + public string QueryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).Type; } /// Backing field for property. private string _scope; @@ -185,11 +185,11 @@ public partial class ViewProperties : /// The start date to pull data from. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriodFrom = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriodFrom = value ?? default(global::System.DateTime); } /// The end date to pull data to. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Origin(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PropertyOrigin.Inlined)] - public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinitionInternal)Query).TimePeriodTo = value ?? default(global::System.DateTime); } + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinitionInternal)Query).TimePeriodTo = value ?? default(global::System.DateTime); } /// Creates an new instance. public ViewProperties() @@ -205,18 +205,26 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Show costs accumulated over time.", SerializedName = @"accumulated", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("true", "false")] + string Accumulated { get; set; } /// Chart type of the main view in Cost Analysis. Required. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Chart type of the main view in Cost Analysis. Required.", SerializedName = @"chart", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Area", "Line", "StackedColumn", "GroupedColumn", "Table")] + string Chart { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. @@ -224,14 +232,20 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Date the user created this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date the user created this view.", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -240,6 +254,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Currency of the current view.", SerializedName = @"currency", PossibleTypes = new [] { typeof(string) })] @@ -251,48 +268,67 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", SerializedName = @"aggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// Has filter expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Has filter expression to use in the report.", SerializedName = @"filter", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The granularity of rows in the report.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of group by expression to use in the report. Report can have up to 2 group by clauses.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigGrouping) })] + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of order by expression to use in the report.", SerializedName = @"sorting", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigSorting) })] + System.Collections.Generic.List DataSetSorting { get; set; } /// Date range of the current view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date range of the current view.", SerializedName = @"dateRange", PossibleTypes = new [] { typeof(string) })] @@ -301,6 +337,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User input name of the view. Required.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -309,22 +348,32 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of KPIs to show in Cost Analysis UI.", SerializedName = @"kpis", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties) })] + System.Collections.Generic.List Kpi { get; set; } /// Metric to use when displaying costs. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Metric to use when displaying costs.", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost", "AHUB")] + string Metric { get; set; } /// Date when the user last modified this view. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date when the user last modified this view.", SerializedName = @"modifiedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -333,14 +382,20 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", SerializedName = @"pivots", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties) })] + System.Collections.Generic.List Pivot { get; set; } /// If true, report includes monetary commitment. [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If true, report includes monetary commitment.", SerializedName = @"includeMonetaryCommitment", PossibleTypes = new [] { typeof(bool) })] @@ -351,10 +406,14 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time frame for pulling data for the report. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType) })] - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string QueryTimeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. @@ -362,6 +421,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -380,6 +442,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Cost Management scope to save the view on. 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 ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -388,6 +453,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start date to pull data from.", SerializedName = @"from", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -396,6 +464,9 @@ public partial interface IViewProperties : [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end date to pull data to.", SerializedName = @"to", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -407,14 +478,16 @@ public partial interface IViewPropertiesInternal { /// Show costs accumulated over time. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType? Accumulated { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("true", "false")] + string Accumulated { get; set; } /// Chart type of the main view in Cost Analysis. Required. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType? Chart { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Area", "Line", "StackedColumn", "GroupedColumn", "Table")] + string Chart { get; set; } /// /// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report /// includes all columns. /// - string[] ConfigurationColumn { get; set; } + System.Collections.Generic.List ConfigurationColumn { get; set; } /// Date the user created this view. global::System.DateTime? CreatedOn { get; set; } /// Currency of the current view. @@ -423,46 +496,49 @@ public partial interface IViewPropertiesInternal /// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the /// aggregated column. Report can have up to 2 aggregation clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetAggregation DataSetAggregation { get; set; } /// /// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping /// are provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } /// Has filter expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigFilter DataSetFilter { get; set; } /// The granularity of rows in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType? DataSetGranularity { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Monthly")] + string DataSetGranularity { get; set; } /// /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + System.Collections.Generic.List DataSetGrouping { get; set; } /// Array of order by expression to use in the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + System.Collections.Generic.List DataSetSorting { get; set; } /// Date range of the current view. string DateRange { get; set; } /// User input name of the view. Required. string DisplayName { get; set; } /// List of KPIs to show in Cost Analysis UI. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + System.Collections.Generic.List Kpi { get; set; } /// Metric to use when displaying costs. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType? Metric { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost", "AHUB")] + string Metric { get; set; } /// Date when the user last modified this view. global::System.DateTime? ModifiedOn { get; set; } /// Configuration of 3 sub-views in the Cost Analysis UI. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + System.Collections.Generic.List Pivot { get; set; } /// Query body configuration. Required. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDefinition Query { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDefinition Query { get; set; } /// Has definition for data in this report config. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigDataset QueryDataSet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigDataset QueryDataSet { get; set; } /// If true, report includes monetary commitment. bool? QueryIncludeMonetaryCommitment { get; set; } /// Has time period for pulling data for the report. - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IReportConfigTimePeriod QueryTimePeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IReportConfigTimePeriod QueryTimePeriod { get; set; } /// /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. /// - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType? QueryTimeframe { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("WeekToDate", "MonthToDate", "YearToDate", "Custom")] + string QueryTimeframe { get; set; } /// /// The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents /// both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.json.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.json.cs similarity index 89% rename from generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.json.cs rename to generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.json.cs index cd2a73f7d13d..fef1885ad31d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/ViewProperties.json.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/api/Models/ViewProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001 +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ViewProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IViewProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IViewProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject json ? new ViewProperties(json) : null; } @@ -87,19 +87,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T AddIf( null != this._query ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._query.ToJson(null,serializationMode) : null, "query" ,container.Add ); AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._createdOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._modifiedOn ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._modifiedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "modifiedOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._dateRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._dateRange.ToString()) : null, "dateRange" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); } @@ -140,18 +140,18 @@ internal ViewProperties(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtim { return; } - {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.ReportConfigDefinition.FromJson(__jsonQuery) : Query;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_modifiedOn = If( json?.PropertyT("modifiedOn"), out var __jsonModifiedOn) ? global::System.DateTime.TryParse((string)__jsonModifiedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonModifiedOnValue) ? __jsonModifiedOnValue : ModifiedOn : ModifiedOn;} - {_dateRange = If( json?.PropertyT("dateRange"), out var __jsonDateRange) ? (string)__jsonDateRange : (string)DateRange;} - {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)Currency;} - {_chart = If( json?.PropertyT("chart"), out var __jsonChart) ? (string)__jsonChart : (string)Chart;} - {_accumulated = If( json?.PropertyT("accumulated"), out var __jsonAccumulated) ? (string)__jsonAccumulated : (string)Accumulated;} - {_metric = If( json?.PropertyT("metric"), out var __jsonMetric) ? (string)__jsonMetric : (string)Metric;} - {_kpi = If( json?.PropertyT("kpis"), out var __jsonKpis) ? If( __jsonKpis as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IKpiProperties) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.KpiProperties.FromJson(__u) )) ))() : null : Kpi;} - {_pivot = If( json?.PropertyT("pivots"), out var __jsonPivots) ? If( __jsonPivots as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IPivotProperties) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.PivotProperties.FromJson(__p) )) ))() : null : Pivot;} + {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ReportConfigDefinition.FromJson(__jsonQuery) : _query;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_modifiedOn = If( json?.PropertyT("modifiedOn"), out var __jsonModifiedOn) ? global::System.DateTime.TryParse((string)__jsonModifiedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonModifiedOnValue) ? __jsonModifiedOnValue : _modifiedOn : _modifiedOn;} + {_dateRange = If( json?.PropertyT("dateRange"), out var __jsonDateRange) ? (string)__jsonDateRange : (string)_dateRange;} + {_currency = If( json?.PropertyT("currency"), out var __jsonCurrency) ? (string)__jsonCurrency : (string)_currency;} + {_chart = If( json?.PropertyT("chart"), out var __jsonChart) ? (string)__jsonChart : (string)_chart;} + {_accumulated = If( json?.PropertyT("accumulated"), out var __jsonAccumulated) ? (string)__jsonAccumulated : (string)_accumulated;} + {_metric = If( json?.PropertyT("metric"), out var __jsonMetric) ? (string)__jsonMetric : (string)_metric;} + {_kpi = If( json?.PropertyT("kpis"), out var __jsonKpis) ? If( __jsonKpis as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IKpiProperties) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.KpiProperties.FromJson(__u) )) ))() : null : _kpi;} + {_pivot = If( json?.PropertyT("pivots"), out var __jsonPivots) ? If( __jsonPivots as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IPivotProperties) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.PivotProperties.FromJson(__p) )) ))() : null : _pivot;} AfterFromJson(json); } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.Completer.cs deleted file mode 100644 index e07b05f76b95..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Show costs accumulated over time. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedTypeTypeConverter))] - public partial struct AccumulatedType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "true".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'true'", "true", global::System.Management.Automation.CompletionResultType.ParameterValue, "true"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "false".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'false'", "false", global::System.Management.Automation.CompletionResultType.ParameterValue, "false"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.TypeConverter.cs deleted file mode 100644 index 10fe4f9232aa..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Show costs accumulated over time. - public partial class AccumulatedTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccumulatedType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.cs deleted file mode 100644 index 44879129fe42..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AccumulatedType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Show costs accumulated over time. - public partial struct AccumulatedType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType False = @"false"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType True = @"true"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AccumulatedType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AccumulatedType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AccumulatedType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AccumulatedType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AccumulatedType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AccumulatedType && Equals((AccumulatedType)obj); - } - - /// Returns hashCode for enum AccumulatedType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AccumulatedType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AccumulatedType - /// the value to convert to an instance of . - - public static implicit operator AccumulatedType(string value) - { - return new AccumulatedType(value); - } - - /// Implicit operator to convert AccumulatedType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e) - { - return e._value; - } - - /// Overriding != operator for enum AccumulatedType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AccumulatedType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AccumulatedType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.Completer.cs deleted file mode 100644 index 0f976db96e85..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Alert category - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategoryTypeConverter))] - public partial struct AlertCategory : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cost'", "Cost", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Usage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Usage'", "Usage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Usage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Billing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Billing'", "Billing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Billing"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "System".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'System'", "System", global::System.Management.Automation.CompletionResultType.ParameterValue, "System"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.TypeConverter.cs deleted file mode 100644 index 5404827bbf44..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Alert category - public partial class AlertCategoryTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertCategory.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.cs deleted file mode 100644 index 014e233296d4..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCategory.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Alert category - public partial struct AlertCategory : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory Billing = @"Billing"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory Cost = @"Cost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory System1 = @"System"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory Usage = @"Usage"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertCategory(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertCategory - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertCategory(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertCategory - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertCategory (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertCategory && Equals((AlertCategory)obj); - } - - /// Returns hashCode for enum AlertCategory - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertCategory - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertCategory - /// the value to convert to an instance of . - - public static implicit operator AlertCategory(string value) - { - return new AlertCategory(value); - } - - /// Implicit operator to convert AlertCategory to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e) - { - return e._value; - } - - /// Overriding != operator for enum AlertCategory - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertCategory - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCategory e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.Completer.cs deleted file mode 100644 index 9af00c69bd23..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.Completer.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Criteria that triggered alert - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteriaTypeConverter))] - public partial struct AlertCriteria : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CostThresholdExceeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CostThresholdExceeded'", "CostThresholdExceeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "CostThresholdExceeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UsageThresholdExceeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UsageThresholdExceeded'", "UsageThresholdExceeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "UsageThresholdExceeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreditThresholdApproaching".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CreditThresholdApproaching'", "CreditThresholdApproaching", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreditThresholdApproaching"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreditThresholdReached".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CreditThresholdReached'", "CreditThresholdReached", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreditThresholdReached"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "QuotaThresholdApproaching".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'QuotaThresholdApproaching'", "QuotaThresholdApproaching", global::System.Management.Automation.CompletionResultType.ParameterValue, "QuotaThresholdApproaching"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "QuotaThresholdReached".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'QuotaThresholdReached'", "QuotaThresholdReached", global::System.Management.Automation.CompletionResultType.ParameterValue, "QuotaThresholdReached"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MultiCurrency".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MultiCurrency'", "MultiCurrency", global::System.Management.Automation.CompletionResultType.ParameterValue, "MultiCurrency"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForecastCostThresholdExceeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForecastCostThresholdExceeded'", "ForecastCostThresholdExceeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForecastCostThresholdExceeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForecastUsageThresholdExceeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForecastUsageThresholdExceeded'", "ForecastUsageThresholdExceeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForecastUsageThresholdExceeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvoiceDueDateApproaching".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvoiceDueDateApproaching'", "InvoiceDueDateApproaching", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvoiceDueDateApproaching"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvoiceDueDateReached".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvoiceDueDateReached'", "InvoiceDueDateReached", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvoiceDueDateReached"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CrossCloudNewDataAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CrossCloudNewDataAvailable'", "CrossCloudNewDataAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "CrossCloudNewDataAvailable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CrossCloudCollectionError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CrossCloudCollectionError'", "CrossCloudCollectionError", global::System.Management.Automation.CompletionResultType.ParameterValue, "CrossCloudCollectionError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GeneralThresholdError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GeneralThresholdError'", "GeneralThresholdError", global::System.Management.Automation.CompletionResultType.ParameterValue, "GeneralThresholdError"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.TypeConverter.cs deleted file mode 100644 index 5cf20f43bf11..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Criteria that triggered alert - public partial class AlertCriteriaTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertCriteria.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.cs deleted file mode 100644 index 42596366b176..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertCriteria.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Criteria that triggered alert - public partial struct AlertCriteria : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria CostThresholdExceeded = @"CostThresholdExceeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria CreditThresholdApproaching = @"CreditThresholdApproaching"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria CreditThresholdReached = @"CreditThresholdReached"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria CrossCloudCollectionError = @"CrossCloudCollectionError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria CrossCloudNewDataAvailable = @"CrossCloudNewDataAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria ForecastCostThresholdExceeded = @"ForecastCostThresholdExceeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria ForecastUsageThresholdExceeded = @"ForecastUsageThresholdExceeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria GeneralThresholdError = @"GeneralThresholdError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria InvoiceDueDateApproaching = @"InvoiceDueDateApproaching"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria InvoiceDueDateReached = @"InvoiceDueDateReached"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria MultiCurrency = @"MultiCurrency"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria QuotaThresholdApproaching = @"QuotaThresholdApproaching"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria QuotaThresholdReached = @"QuotaThresholdReached"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria UsageThresholdExceeded = @"UsageThresholdExceeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertCriteria(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertCriteria - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertCriteria(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertCriteria - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertCriteria (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertCriteria && Equals((AlertCriteria)obj); - } - - /// Returns hashCode for enum AlertCriteria - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertCriteria - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertCriteria - /// the value to convert to an instance of . - - public static implicit operator AlertCriteria(string value) - { - return new AlertCriteria(value); - } - - /// Implicit operator to convert AlertCriteria to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e) - { - return e._value; - } - - /// Overriding != operator for enum AlertCriteria - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertCriteria - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertCriteria e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.Completer.cs deleted file mode 100644 index ef5a34e437af..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.Completer.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// operator used to compare currentSpend with amount - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperatorTypeConverter))] - public partial struct AlertOperator : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "EqualTo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'EqualTo'", "EqualTo", global::System.Management.Automation.CompletionResultType.ParameterValue, "EqualTo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThan'", "GreaterThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThanOrEqualTo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThanOrEqualTo'", "GreaterThanOrEqualTo", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThanOrEqualTo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThan'", "LessThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThanOrEqualTo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThanOrEqualTo'", "LessThanOrEqualTo", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThanOrEqualTo"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.TypeConverter.cs deleted file mode 100644 index 659db75c51af..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// operator used to compare currentSpend with amount - public partial class AlertOperatorTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertOperator.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.cs deleted file mode 100644 index 047489c54081..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertOperator.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// operator used to compare currentSpend with amount - public partial struct AlertOperator : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator EqualTo = @"EqualTo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator GreaterThan = @"GreaterThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator GreaterThanOrEqualTo = @"GreaterThanOrEqualTo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator LessThan = @"LessThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator LessThanOrEqualTo = @"LessThanOrEqualTo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator None = @"None"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertOperator(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertOperator - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertOperator(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertOperator - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertOperator (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertOperator && Equals((AlertOperator)obj); - } - - /// Returns hashCode for enum AlertOperator - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertOperator - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertOperator - /// the value to convert to an instance of . - - public static implicit operator AlertOperator(string value) - { - return new AlertOperator(value); - } - - /// Implicit operator to convert AlertOperator to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e) - { - return e._value; - } - - /// Overriding != operator for enum AlertOperator - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertOperator - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertOperator e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.Completer.cs deleted file mode 100644 index 3e120f31595f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Source of alert - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSourceTypeConverter))] - public partial struct AlertSource : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Preset".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Preset'", "Preset", global::System.Management.Automation.CompletionResultType.ParameterValue, "Preset"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.TypeConverter.cs deleted file mode 100644 index 173041694970..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Source of alert - public partial class AlertSourceTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertSource.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.cs deleted file mode 100644 index 2f83c0b8c9cb..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertSource.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Source of alert - public partial struct AlertSource : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource Preset = @"Preset"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertSource(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertSource - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertSource(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertSource - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertSource (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertSource && Equals((AlertSource)obj); - } - - /// Returns hashCode for enum AlertSource - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertSource - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertSource - /// the value to convert to an instance of . - - public static implicit operator AlertSource(string value) - { - return new AlertSource(value); - } - - /// Implicit operator to convert AlertSource to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e) - { - return e._value; - } - - /// Overriding != operator for enum AlertSource - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertSource - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertSource e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.Completer.cs deleted file mode 100644 index 0a5302ec692f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// alert status - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatusTypeConverter))] - public partial struct AlertStatus : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Overridden".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Overridden'", "Overridden", global::System.Management.Automation.CompletionResultType.ParameterValue, "Overridden"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Resolved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Resolved'", "Resolved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Resolved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Dismissed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Dismissed'", "Dismissed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dismissed"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.TypeConverter.cs deleted file mode 100644 index 20fee68478c6..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// alert status - public partial class AlertStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.cs deleted file mode 100644 index 69f3edd66fec..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertStatus.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// alert status - public partial struct AlertStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus Dismissed = @"Dismissed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus Overridden = @"Overridden"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus Resolved = @"Resolved"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertStatus - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertStatus (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertStatus && Equals((AlertStatus)obj); - } - - /// Returns hashCode for enum AlertStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertStatus - /// the value to convert to an instance of . - - public static implicit operator AlertStatus(string value) - { - return new AlertStatus(value); - } - - /// Implicit operator to convert AlertStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e) - { - return e._value; - } - - /// Overriding != operator for enum AlertStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.Completer.cs deleted file mode 100644 index f3bb409909a9..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.Completer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Type of timegrain cadence - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainTypeTypeConverter))] - public partial struct AlertTimeGrainType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monthly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Monthly'", "Monthly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monthly"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Quarterly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Quarterly'", "Quarterly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Quarterly"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Annually".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Annually'", "Annually", global::System.Management.Automation.CompletionResultType.ParameterValue, "Annually"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingMonth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingMonth'", "BillingMonth", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingMonth"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingQuarter".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingQuarter'", "BillingQuarter", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingQuarter"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingAnnual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingAnnual'", "BillingAnnual", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingAnnual"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.TypeConverter.cs deleted file mode 100644 index 014310e4f90a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Type of timegrain cadence - public partial class AlertTimeGrainTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertTimeGrainType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.cs deleted file mode 100644 index 63a1c207ff84..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertTimeGrainType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Type of timegrain cadence - public partial struct AlertTimeGrainType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType Annually = @"Annually"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType BillingAnnual = @"BillingAnnual"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType BillingMonth = @"BillingMonth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType BillingQuarter = @"BillingQuarter"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType Monthly = @"Monthly"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType Quarterly = @"Quarterly"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertTimeGrainType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertTimeGrainType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertTimeGrainType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertTimeGrainType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertTimeGrainType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertTimeGrainType && Equals((AlertTimeGrainType)obj); - } - - /// Returns hashCode for enum AlertTimeGrainType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertTimeGrainType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertTimeGrainType - /// the value to convert to an instance of . - - public static implicit operator AlertTimeGrainType(string value) - { - return new AlertTimeGrainType(value); - } - - /// Implicit operator to convert AlertTimeGrainType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e) - { - return e._value; - } - - /// Overriding != operator for enum AlertTimeGrainType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertTimeGrainType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTimeGrainType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.Completer.cs deleted file mode 100644 index e66477877911..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.Completer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// type of alert - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertTypeTypeConverter))] - public partial struct AlertType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Budget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Budget'", "Budget", global::System.Management.Automation.CompletionResultType.ParameterValue, "Budget"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invoice".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Invoice'", "Invoice", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invoice"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Credit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Credit'", "Credit", global::System.Management.Automation.CompletionResultType.ParameterValue, "Credit"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Quota".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Quota'", "Quota", global::System.Management.Automation.CompletionResultType.ParameterValue, "Quota"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "General".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'General'", "General", global::System.Management.Automation.CompletionResultType.ParameterValue, "General"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "xCloud".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'xCloud'", "xCloud", global::System.Management.Automation.CompletionResultType.ParameterValue, "xCloud"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BudgetForecast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BudgetForecast'", "BudgetForecast", global::System.Management.Automation.CompletionResultType.ParameterValue, "BudgetForecast"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.TypeConverter.cs deleted file mode 100644 index 08e303e435ae..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// type of alert - public partial class AlertTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.cs deleted file mode 100644 index 3db9b6df20c7..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/AlertType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// type of alert - public partial struct AlertType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType Budget = @"Budget"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType BudgetForecast = @"BudgetForecast"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType Credit = @"Credit"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType General = @"General"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType Invoice = @"Invoice"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType Quota = @"Quota"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType XCloud = @"xCloud"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AlertType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AlertType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AlertType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AlertType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AlertType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is AlertType && Equals((AlertType)obj); - } - - /// Returns hashCode for enum AlertType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AlertType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AlertType - /// the value to convert to an instance of . - - public static implicit operator AlertType(string value) - { - return new AlertType(value); - } - - /// Implicit operator to convert AlertType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e) - { - return e._value; - } - - /// Overriding != operator for enum AlertType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AlertType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.AlertType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.Completer.cs deleted file mode 100644 index 189dea06d47c..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Chart type of the main view in Cost Analysis. Required. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartTypeTypeConverter))] - public partial struct ChartType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Area".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Area'", "Area", global::System.Management.Automation.CompletionResultType.ParameterValue, "Area"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Line".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Line'", "Line", global::System.Management.Automation.CompletionResultType.ParameterValue, "Line"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "StackedColumn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'StackedColumn'", "StackedColumn", global::System.Management.Automation.CompletionResultType.ParameterValue, "StackedColumn"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GroupedColumn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GroupedColumn'", "GroupedColumn", global::System.Management.Automation.CompletionResultType.ParameterValue, "GroupedColumn"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Table".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Table'", "Table", global::System.Management.Automation.CompletionResultType.ParameterValue, "Table"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.TypeConverter.cs deleted file mode 100644 index f4a2795cd59d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Chart type of the main view in Cost Analysis. Required. - public partial class ChartTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ChartType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.cs deleted file mode 100644 index bbaef622ff31..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ChartType.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Chart type of the main view in Cost Analysis. Required. - public partial struct ChartType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType Area = @"Area"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType GroupedColumn = @"GroupedColumn"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType Line = @"Line"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType StackedColumn = @"StackedColumn"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType Table = @"Table"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ChartType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ChartType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ChartType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ChartType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ChartType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ChartType && Equals((ChartType)obj); - } - - /// Returns hashCode for enum ChartType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ChartType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ChartType - /// the value to convert to an instance of . - - public static implicit operator ChartType(string value) - { - return new ChartType(value); - } - - /// Implicit operator to convert ChartType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e) - { - return e._value; - } - - /// Overriding != operator for enum ChartType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ChartType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ChartType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.Completer.cs deleted file mode 100644 index 20d369cb29c8..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The data format of the report - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormatTypeConverter))] - public partial struct CostDetailsDataFormat : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Csv".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Csv'", "Csv", global::System.Management.Automation.CompletionResultType.ParameterValue, "Csv"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs deleted file mode 100644 index d88b8824bb60..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The data format of the report - public partial class CostDetailsDataFormatTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CostDetailsDataFormat.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.cs deleted file mode 100644 index 40ed764fbe09..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsDataFormat.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The data format of the report - public partial struct CostDetailsDataFormat : - System.IEquatable - { - /// Csv data format. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat Csv = @"Csv"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CostDetailsDataFormat(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CostDetailsDataFormat - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CostDetailsDataFormat(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CostDetailsDataFormat - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CostDetailsDataFormat (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CostDetailsDataFormat && Equals((CostDetailsDataFormat)obj); - } - - /// Returns hashCode for enum CostDetailsDataFormat - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CostDetailsDataFormat - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CostDetailsDataFormat - /// the value to convert to an instance of . - - public static implicit operator CostDetailsDataFormat(string value) - { - return new CostDetailsDataFormat(value); - } - - /// Implicit operator to convert CostDetailsDataFormat to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e) - { - return e._value; - } - - /// Overriding != operator for enum CostDetailsDataFormat - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CostDetailsDataFormat - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsDataFormat e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.Completer.cs deleted file mode 100644 index 49452e89e1b1..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the detailed report. By default ActualCost is provided - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricTypeTypeConverter))] - public partial struct CostDetailsMetricType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActualCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ActualCost'", "ActualCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActualCost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AmortizedCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AmortizedCost'", "AmortizedCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "AmortizedCost"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.TypeConverter.cs deleted file mode 100644 index 571632add5e8..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the detailed report. By default ActualCost is provided - public partial class CostDetailsMetricTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CostDetailsMetricType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.cs deleted file mode 100644 index ff60592b5082..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsMetricType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the detailed report. By default ActualCost is provided - public partial struct CostDetailsMetricType : - System.IEquatable - { - /// Actual cost data. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType ActualCost = @"ActualCost"; - - /// Amortized cost data. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType AmortizedCost = @"AmortizedCost"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CostDetailsMetricType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CostDetailsMetricType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CostDetailsMetricType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CostDetailsMetricType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CostDetailsMetricType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CostDetailsMetricType && Equals((CostDetailsMetricType)obj); - } - - /// Returns hashCode for enum CostDetailsMetricType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CostDetailsMetricType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CostDetailsMetricType - /// the value to convert to an instance of . - - public static implicit operator CostDetailsMetricType(string value) - { - return new CostDetailsMetricType(value); - } - - /// Implicit operator to convert CostDetailsMetricType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e) - { - return e._value; - } - - /// Overriding != operator for enum CostDetailsMetricType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CostDetailsMetricType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.Completer.cs deleted file mode 100644 index d94968997e5d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the cost details operation - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusTypeTypeConverter))] - public partial struct CostDetailsStatusType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoDataFound".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoDataFound'", "NoDataFound", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoDataFound"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.TypeConverter.cs deleted file mode 100644 index 17798054adf2..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the cost details operation - public partial class CostDetailsStatusTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CostDetailsStatusType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.cs deleted file mode 100644 index 770ee4fa8740..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/CostDetailsStatusType.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the cost details operation - public partial struct CostDetailsStatusType : - System.IEquatable - { - /// Operation is Completed. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType Completed = @"Completed"; - - /// Operation Failed. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType Failed = @"Failed"; - - /// Operation is Completed and no cost data found. - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType NoDataFound = @"NoDataFound"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CostDetailsStatusType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CostDetailsStatusType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CostDetailsStatusType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CostDetailsStatusType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CostDetailsStatusType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CostDetailsStatusType && Equals((CostDetailsStatusType)obj); - } - - /// Returns hashCode for enum CostDetailsStatusType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CostDetailsStatusType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CostDetailsStatusType - /// the value to convert to an instance of . - - public static implicit operator CostDetailsStatusType(string value) - { - return new CostDetailsStatusType(value); - } - - /// Implicit operator to convert CostDetailsStatusType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e) - { - return e._value; - } - - /// Overriding != operator for enum CostDetailsStatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CostDetailsStatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsStatusType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.Completer.cs deleted file mode 100644 index 07aee3a5c4b6..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.Completer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The last known status of the export execution. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatusTypeConverter))] - public partial struct ExecutionStatus : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Queued".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Queued'", "Queued", global::System.Management.Automation.CompletionResultType.ParameterValue, "Queued"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Timeout".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Timeout'", "Timeout", global::System.Management.Automation.CompletionResultType.ParameterValue, "Timeout"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NewDataNotAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NewDataNotAvailable'", "NewDataNotAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "NewDataNotAvailable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DataNotAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DataNotAvailable'", "DataNotAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "DataNotAvailable"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.TypeConverter.cs deleted file mode 100644 index fc9685e612d6..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The last known status of the export execution. - public partial class ExecutionStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ExecutionStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.cs deleted file mode 100644 index fd609066a1d5..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionStatus.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The last known status of the export execution. - public partial struct ExecutionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus Completed = @"Completed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus DataNotAvailable = @"DataNotAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus InProgress = @"InProgress"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus NewDataNotAvailable = @"NewDataNotAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus Queued = @"Queued"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus Timeout = @"Timeout"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ExecutionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExecutionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExecutionStatus - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ExecutionStatus (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ExecutionStatus && Equals((ExecutionStatus)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ExecutionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExecutionStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExecutionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ExecutionStatus - /// the value to convert to an instance of . - - public static implicit operator ExecutionStatus(string value) - { - return new ExecutionStatus(value); - } - - /// Implicit operator to convert ExecutionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ExecutionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExecutionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.Completer.cs deleted file mode 100644 index 7e5336de340e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the export execution. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionTypeTypeConverter))] - public partial struct ExecutionType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OnDemand".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OnDemand'", "OnDemand", global::System.Management.Automation.CompletionResultType.ParameterValue, "OnDemand"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Scheduled'", "Scheduled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduled"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.TypeConverter.cs deleted file mode 100644 index d794d5773b4a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the export execution. - public partial class ExecutionTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ExecutionType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.cs deleted file mode 100644 index dc5ba7056319..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExecutionType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the export execution. - public partial struct ExecutionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType OnDemand = @"OnDemand"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType Scheduled = @"Scheduled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ExecutionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExecutionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExecutionType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ExecutionType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ExecutionType && Equals((ExecutionType)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ExecutionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExecutionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExecutionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ExecutionType - /// the value to convert to an instance of . - - public static implicit operator ExecutionType(string value) - { - return new ExecutionType(value); - } - - /// Implicit operator to convert ExecutionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e) - { - return e._value; - } - - /// Overriding != operator for enum ExecutionType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExecutionType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExecutionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.Completer.cs deleted file mode 100644 index 3b6800c364aa..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the query. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportTypeTypeConverter))] - public partial struct ExportType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Usage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Usage'", "Usage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Usage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActualCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ActualCost'", "ActualCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActualCost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AmortizedCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AmortizedCost'", "AmortizedCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "AmortizedCost"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.TypeConverter.cs deleted file mode 100644 index e109b95ff975..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the query. - public partial class ExportTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ExportType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.cs deleted file mode 100644 index 9d0ffdfb0c74..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExportType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the query. - public partial struct ExportType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType ActualCost = @"ActualCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType AmortizedCost = @"AmortizedCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Usage = @"Usage"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ExportType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExportType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExportType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ExportType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ExportType && Equals((ExportType)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ExportType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExportType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExportType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ExportType - /// the value to convert to an instance of . - - public static implicit operator ExportType(string value) - { - return new ExportType(value); - } - - /// Implicit operator to convert ExportType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e) - { - return e._value; - } - - /// Overriding != operator for enum ExportType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExportType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.Completer.cs deleted file mode 100644 index 1af014ba4546..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Argument completer implementation for ExternalCloudProviderType. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderTypeTypeConverter))] - public partial struct ExternalCloudProviderType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "externalSubscriptions".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'externalSubscriptions'", "externalSubscriptions", global::System.Management.Automation.CompletionResultType.ParameterValue, "externalSubscriptions"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "externalBillingAccounts".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'externalBillingAccounts'", "externalBillingAccounts", global::System.Management.Automation.CompletionResultType.ParameterValue, "externalBillingAccounts"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs deleted file mode 100644 index 796414678b2b..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// TypeConverter implementation for ExternalCloudProviderType. - public partial class ExternalCloudProviderTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ExternalCloudProviderType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.cs deleted file mode 100644 index af372457fa28..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ExternalCloudProviderType.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - public partial struct ExternalCloudProviderType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType ExternalBillingAccounts = @"externalBillingAccounts"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType ExternalSubscriptions = @"externalSubscriptions"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ExternalCloudProviderType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExternalCloudProviderType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExternalCloudProviderType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ExternalCloudProviderType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ExternalCloudProviderType && Equals((ExternalCloudProviderType)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ExternalCloudProviderType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExternalCloudProviderType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExternalCloudProviderType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ExternalCloudProviderType - /// the value to convert to an instance of . - - public static implicit operator ExternalCloudProviderType(string value) - { - return new ExternalCloudProviderType(value); - } - - /// Implicit operator to convert ExternalCloudProviderType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e) - { - return e._value; - } - - /// Overriding != operator for enum ExternalCloudProviderType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExternalCloudProviderType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.Completer.cs deleted file mode 100644 index 66b82a96f78e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the forecast. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastTypeTypeConverter))] - public partial struct ForecastType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Usage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Usage'", "Usage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Usage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActualCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ActualCost'", "ActualCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActualCost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AmortizedCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AmortizedCost'", "AmortizedCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "AmortizedCost"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.TypeConverter.cs deleted file mode 100644 index 3579776a4cd1..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the forecast. - public partial class ForecastTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ForecastType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.cs deleted file mode 100644 index 953766d7c80e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ForecastType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the forecast. - public partial struct ForecastType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType ActualCost = @"ActualCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType AmortizedCost = @"AmortizedCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType Usage = @"Usage"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ForecastType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ForecastType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ForecastType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ForecastType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ForecastType && Equals((ForecastType)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ForecastType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ForecastType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ForecastType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ForecastType - /// the value to convert to an instance of . - - public static implicit operator ForecastType(string value) - { - return new ForecastType(value); - } - - /// Implicit operator to convert ForecastType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e) - { - return e._value; - } - - /// Overriding != operator for enum ForecastType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ForecastType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ForecastType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.Completer.cs deleted file mode 100644 index 7487004f928a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The format of the export being delivered. Currently only 'Csv' is supported. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatTypeTypeConverter))] - public partial struct FormatType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Csv".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Csv'", "Csv", global::System.Management.Automation.CompletionResultType.ParameterValue, "Csv"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.TypeConverter.cs deleted file mode 100644 index 9f2e6b61413a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The format of the export being delivered. Currently only 'Csv' is supported. - public partial class FormatTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => FormatType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.cs deleted file mode 100644 index 005a06e40dc7..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FormatType.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The format of the export being delivered. Currently only 'Csv' is supported. - public partial struct FormatType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Csv = @"Csv"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FormatType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FormatType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FormatType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FormatType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is FormatType && Equals((FormatType)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FormatType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FormatType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FormatType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FormatType - /// the value to convert to an instance of . - - public static implicit operator FormatType(string value) - { - return new FormatType(value); - } - - /// Implicit operator to convert FormatType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e) - { - return e._value; - } - - /// Overriding != operator for enum FormatType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FormatType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.Completer.cs deleted file mode 100644 index 58a8345f4865..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The name of the column to aggregate. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionNameTypeConverter))] - public partial struct FunctionName : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PreTaxCostUSD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PreTaxCostUSD'", "PreTaxCostUSD", global::System.Management.Automation.CompletionResultType.ParameterValue, "PreTaxCostUSD"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cost'", "Cost", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CostUSD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CostUSD'", "CostUSD", global::System.Management.Automation.CompletionResultType.ParameterValue, "CostUSD"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PreTaxCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PreTaxCost'", "PreTaxCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "PreTaxCost"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.TypeConverter.cs deleted file mode 100644 index 0c5541e0427f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The name of the column to aggregate. - public partial class FunctionNameTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => FunctionName.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.cs deleted file mode 100644 index f8a842b27266..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/FunctionName.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The name of the column to aggregate. - public partial struct FunctionName : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName Cost = @"Cost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName CostUsd = @"CostUSD"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName PreTaxCost = @"PreTaxCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName PreTaxCostUsd = @"PreTaxCostUSD"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FunctionName - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FunctionName(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FunctionName - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FunctionName (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is FunctionName && Equals((FunctionName)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FunctionName(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FunctionName - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FunctionName - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FunctionName - /// the value to convert to an instance of . - - public static implicit operator FunctionName(string value) - { - return new FunctionName(value); - } - - /// Implicit operator to convert FunctionName to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e) - { - return e._value; - } - - /// Overriding != operator for enum FunctionName - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FunctionName - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FunctionName e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.Completer.cs deleted file mode 100644 index e9b675f4631c..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the forecast. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityTypeTypeConverter))] - public partial struct GranularityType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Daily".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Daily'", "Daily", global::System.Management.Automation.CompletionResultType.ParameterValue, "Daily"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.TypeConverter.cs deleted file mode 100644 index 2b8bd29741ed..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the forecast. - public partial class GranularityTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => GranularityType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.cs deleted file mode 100644 index 4da6714d8fa9..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/GranularityType.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the forecast. - public partial struct GranularityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType Daily = @"Daily"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to GranularityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new GranularityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type GranularityType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type GranularityType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is GranularityType && Equals((GranularityType)obj); - } - - /// Returns hashCode for enum GranularityType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private GranularityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for GranularityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to GranularityType - /// the value to convert to an instance of . - - public static implicit operator GranularityType(string value) - { - return new GranularityType(value); - } - - /// Implicit operator to convert GranularityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e) - { - return e._value; - } - - /// Overriding != operator for enum GranularityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum GranularityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.Completer.cs deleted file mode 100644 index 29d2696b600c..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// KPI type (Forecast, Budget). - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiTypeTypeConverter))] - public partial struct KpiType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Forecast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Forecast'", "Forecast", global::System.Management.Automation.CompletionResultType.ParameterValue, "Forecast"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Budget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Budget'", "Budget", global::System.Management.Automation.CompletionResultType.ParameterValue, "Budget"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.TypeConverter.cs deleted file mode 100644 index c514a78754d7..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// KPI type (Forecast, Budget). - public partial class KpiTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => KpiType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.cs deleted file mode 100644 index 55ef1b934402..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/KpiType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// KPI type (Forecast, Budget). - public partial struct KpiType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType Budget = @"Budget"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType Forecast = @"Forecast"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to KpiType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KpiType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KpiType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type KpiType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is KpiType && Equals((KpiType)obj); - } - - /// Returns hashCode for enum KpiType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private KpiType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KpiType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KpiType - /// the value to convert to an instance of . - - public static implicit operator KpiType(string value) - { - return new KpiType(value); - } - - /// Implicit operator to convert KpiType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e) - { - return e._value; - } - - /// Overriding != operator for enum KpiType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KpiType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.KpiType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.Completer.cs deleted file mode 100644 index 44bc45b4be72..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Metric to use when displaying costs. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricTypeTypeConverter))] - public partial struct MetricType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActualCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ActualCost'", "ActualCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActualCost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AmortizedCost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AmortizedCost'", "AmortizedCost", global::System.Management.Automation.CompletionResultType.ParameterValue, "AmortizedCost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AHUB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AHUB'", "AHUB", global::System.Management.Automation.CompletionResultType.ParameterValue, "AHUB"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.TypeConverter.cs deleted file mode 100644 index f916c02443a8..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Metric to use when displaying costs. - public partial class MetricTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MetricType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.cs deleted file mode 100644 index 5228cd48696d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/MetricType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Metric to use when displaying costs. - public partial struct MetricType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType ActualCost = @"ActualCost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType Ahub = @"AHUB"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType AmortizedCost = @"AmortizedCost"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MetricType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MetricType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MetricType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MetricType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is MetricType && Equals((MetricType)obj); - } - - /// Returns hashCode for enum MetricType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private MetricType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MetricType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MetricType - /// the value to convert to an instance of . - - public static implicit operator MetricType(string value) - { - return new MetricType(value); - } - - /// Implicit operator to convert MetricType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e) - { - return e._value; - } - - /// Overriding != operator for enum MetricType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MetricType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.MetricType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.Completer.cs deleted file mode 100644 index 92e976da07a7..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the long running operation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusTypeTypeConverter))] - public partial struct OperationStatusType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.TypeConverter.cs deleted file mode 100644 index 051c27ce6dc2..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the long running operation. - public partial class OperationStatusTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OperationStatusType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.cs deleted file mode 100644 index c816190e840f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperationStatusType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The status of the long running operation. - public partial struct OperationStatusType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType Completed = @"Completed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType Running = @"Running"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OperationStatusType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OperationStatusType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OperationStatusType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OperationStatusType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is OperationStatusType && Equals((OperationStatusType)obj); - } - - /// Returns hashCode for enum OperationStatusType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private OperationStatusType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OperationStatusType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OperationStatusType - /// the value to convert to an instance of . - - public static implicit operator OperationStatusType(string value) - { - return new OperationStatusType(value); - } - - /// Implicit operator to convert OperationStatusType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e) - { - return e._value; - } - - /// Overriding != operator for enum OperationStatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OperationStatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperationStatusType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.Completer.cs deleted file mode 100644 index 3b9bea513afc..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The operator to use for comparison. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorTypeTypeConverter))] - public partial struct OperatorType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "In".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'In'", "In", global::System.Management.Automation.CompletionResultType.ParameterValue, "In"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Contains".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Contains'", "Contains", global::System.Management.Automation.CompletionResultType.ParameterValue, "Contains"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.TypeConverter.cs deleted file mode 100644 index 56d0285e2367..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The operator to use for comparison. - public partial class OperatorTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => OperatorType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.cs deleted file mode 100644 index b349abb0bff8..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/OperatorType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The operator to use for comparison. - public partial struct OperatorType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType Contains = @"Contains"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType In = @"In"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OperatorType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OperatorType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OperatorType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OperatorType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is OperatorType && Equals((OperatorType)obj); - } - - /// Returns hashCode for enum OperatorType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private OperatorType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OperatorType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OperatorType - /// the value to convert to an instance of . - - public static implicit operator OperatorType(string value) - { - return new OperatorType(value); - } - - /// Implicit operator to convert OperatorType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e) - { - return e._value; - } - - /// Overriding != operator for enum OperatorType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OperatorType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.Completer.cs deleted file mode 100644 index d7d221e6b0c0..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Data type to show in view. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotTypeTypeConverter))] - public partial struct PivotType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Dimension".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Dimension'", "Dimension", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dimension"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TagKey".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TagKey'", "TagKey", global::System.Management.Automation.CompletionResultType.ParameterValue, "TagKey"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.TypeConverter.cs deleted file mode 100644 index 7036c1e09c0b..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Data type to show in view. - public partial class PivotTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PivotType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.cs deleted file mode 100644 index ad3a47c8a02f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/PivotType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Data type to show in view. - public partial struct PivotType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType Dimension = @"Dimension"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType TagKey = @"TagKey"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PivotType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PivotType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PivotType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PivotType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is PivotType && Equals((PivotType)obj); - } - - /// Returns hashCode for enum PivotType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private PivotType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PivotType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PivotType - /// the value to convert to an instance of . - - public static implicit operator PivotType(string value) - { - return new PivotType(value); - } - - /// Implicit operator to convert PivotType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e) - { - return e._value; - } - - /// Overriding != operator for enum PivotType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PivotType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.PivotType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.Completer.cs deleted file mode 100644 index fc431dc2af8c..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the export. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnTypeTypeConverter))] - public partial struct QueryColumnType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Tag".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Tag'", "Tag", global::System.Management.Automation.CompletionResultType.ParameterValue, "Tag"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Dimension".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Dimension'", "Dimension", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dimension"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.TypeConverter.cs deleted file mode 100644 index fb1d3141c419..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the export. - public partial class QueryColumnTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => QueryColumnType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.cs deleted file mode 100644 index a513d4718d1a..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/QueryColumnType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the export. - public partial struct QueryColumnType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType Dimension = @"Dimension"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType Tag = @"Tag"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to QueryColumnType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new QueryColumnType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type QueryColumnType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type QueryColumnType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is QueryColumnType && Equals((QueryColumnType)obj); - } - - /// Returns hashCode for enum QueryColumnType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private QueryColumnType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for QueryColumnType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to QueryColumnType - /// the value to convert to an instance of . - - public static implicit operator QueryColumnType(string value) - { - return new QueryColumnType(value); - } - - /// Implicit operator to convert QueryColumnType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e) - { - return e._value; - } - - /// Overriding != operator for enum QueryColumnType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum QueryColumnType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.QueryColumnType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.Completer.cs deleted file mode 100644 index c981b7b30a77..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The schedule recurrence. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceTypeTypeConverter))] - public partial struct RecurrenceType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Daily".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Daily'", "Daily", global::System.Management.Automation.CompletionResultType.ParameterValue, "Daily"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Weekly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Weekly'", "Weekly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Weekly"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monthly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Monthly'", "Monthly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monthly"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Annually".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Annually'", "Annually", global::System.Management.Automation.CompletionResultType.ParameterValue, "Annually"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.TypeConverter.cs deleted file mode 100644 index 7691e94827a0..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The schedule recurrence. - public partial class RecurrenceTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RecurrenceType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.cs deleted file mode 100644 index b3dff0c35d29..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/RecurrenceType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The schedule recurrence. - public partial struct RecurrenceType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Annually = @"Annually"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Daily = @"Daily"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Monthly = @"Monthly"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Weekly = @"Weekly"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RecurrenceType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RecurrenceType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RecurrenceType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RecurrenceType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is RecurrenceType && Equals((RecurrenceType)obj); - } - - /// Returns hashCode for enum RecurrenceType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private RecurrenceType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RecurrenceType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RecurrenceType - /// the value to convert to an instance of . - - public static implicit operator RecurrenceType(string value) - { - return new RecurrenceType(value); - } - - /// Implicit operator to convert RecurrenceType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e) - { - return e._value; - } - - /// Overriding != operator for enum RecurrenceType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RecurrenceType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.Completer.cs deleted file mode 100644 index c27515203fac..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the report. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnTypeTypeConverter))] - public partial struct ReportConfigColumnType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Tag".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Tag'", "Tag", global::System.Management.Automation.CompletionResultType.ParameterValue, "Tag"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Dimension".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Dimension'", "Dimension", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dimension"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.TypeConverter.cs deleted file mode 100644 index 8627d7ca520d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the report. - public partial class ReportConfigColumnTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReportConfigColumnType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.cs deleted file mode 100644 index babb10fbff0f..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigColumnType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The type of the column in the report. - public partial struct ReportConfigColumnType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType Dimension = @"Dimension"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType Tag = @"Tag"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReportConfigColumnType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReportConfigColumnType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReportConfigColumnType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReportConfigColumnType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ReportConfigColumnType && Equals((ReportConfigColumnType)obj); - } - - /// Returns hashCode for enum ReportConfigColumnType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ReportConfigColumnType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReportConfigColumnType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReportConfigColumnType - /// the value to convert to an instance of . - - public static implicit operator ReportConfigColumnType(string value) - { - return new ReportConfigColumnType(value); - } - - /// Implicit operator to convert ReportConfigColumnType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e) - { - return e._value; - } - - /// Overriding != operator for enum ReportConfigColumnType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReportConfigColumnType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigColumnType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.Completer.cs deleted file mode 100644 index 703e0d8ab078..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Direction of sort. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingTypeTypeConverter))] - public partial struct ReportConfigSortingType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Ascending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Ascending'", "Ascending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ascending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Descending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Descending'", "Descending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Descending"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.TypeConverter.cs deleted file mode 100644 index 4dbc9c5fd8be..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Direction of sort. - public partial class ReportConfigSortingTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReportConfigSortingType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.cs deleted file mode 100644 index 5502f0581a3c..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportConfigSortingType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// Direction of sort. - public partial struct ReportConfigSortingType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType Ascending = @"Ascending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType Descending = @"Descending"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReportConfigSortingType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReportConfigSortingType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReportConfigSortingType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReportConfigSortingType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ReportConfigSortingType && Equals((ReportConfigSortingType)obj); - } - - /// Returns hashCode for enum ReportConfigSortingType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ReportConfigSortingType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReportConfigSortingType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReportConfigSortingType - /// the value to convert to an instance of . - - public static implicit operator ReportConfigSortingType(string value) - { - return new ReportConfigSortingType(value); - } - - /// Implicit operator to convert ReportConfigSortingType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e) - { - return e._value; - } - - /// Overriding != operator for enum ReportConfigSortingType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReportConfigSortingType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportConfigSortingType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.Completer.cs deleted file mode 100644 index b984c165e4c9..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the report. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityTypeTypeConverter))] - public partial struct ReportGranularityType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Daily".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Daily'", "Daily", global::System.Management.Automation.CompletionResultType.ParameterValue, "Daily"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monthly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Monthly'", "Monthly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monthly"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.TypeConverter.cs deleted file mode 100644 index 0c57f7ab0940..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the report. - public partial class ReportGranularityTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReportGranularityType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.cs deleted file mode 100644 index 0ef435578813..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportGranularityType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// The granularity of rows in the report. - public partial struct ReportGranularityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType Daily = @"Daily"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType Monthly = @"Monthly"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReportGranularityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReportGranularityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReportGranularityType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReportGranularityType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ReportGranularityType && Equals((ReportGranularityType)obj); - } - - /// Returns hashCode for enum ReportGranularityType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ReportGranularityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReportGranularityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReportGranularityType - /// the value to convert to an instance of . - - public static implicit operator ReportGranularityType(string value) - { - return new ReportGranularityType(value); - } - - /// Implicit operator to convert ReportGranularityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e) - { - return e._value; - } - - /// Overriding != operator for enum ReportGranularityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReportGranularityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportGranularityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.Completer.cs deleted file mode 100644 index cd57973a004d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.Completer.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeTypeTypeConverter))] - public partial struct ReportTimeframeType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "WeekToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'WeekToDate'", "WeekToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "WeekToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MonthToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MonthToDate'", "MonthToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "MonthToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "YearToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'YearToDate'", "YearToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "YearToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Custom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Custom'", "Custom", global::System.Management.Automation.CompletionResultType.ParameterValue, "Custom"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.TypeConverter.cs deleted file mode 100644 index 7694bba5a4fb..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. - /// - public partial class ReportTimeframeTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReportTimeframeType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.cs deleted file mode 100644 index 971a708ee1b2..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReportTimeframeType.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. - /// - public partial struct ReportTimeframeType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType Custom = @"Custom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType MonthToDate = @"MonthToDate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType WeekToDate = @"WeekToDate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType YearToDate = @"YearToDate"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReportTimeframeType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReportTimeframeType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReportTimeframeType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReportTimeframeType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ReportTimeframeType && Equals((ReportTimeframeType)obj); - } - - /// Returns hashCode for enum ReportTimeframeType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ReportTimeframeType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReportTimeframeType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReportTimeframeType - /// the value to convert to an instance of . - - public static implicit operator ReportTimeframeType(string value) - { - return new ReportTimeframeType(value); - } - - /// Implicit operator to convert ReportTimeframeType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e) - { - return e._value; - } - - /// Overriding != operator for enum ReportTimeframeType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReportTimeframeType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReportTimeframeType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.Completer.cs deleted file mode 100644 index 57338d7b4be8..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.Completer.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchemaTypeConverter))] - public partial struct ReservationReportSchema : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstanceFlexibilityGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InstanceFlexibilityGroup'", "InstanceFlexibilityGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstanceFlexibilityGroup"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstanceFlexibilityRatio".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InstanceFlexibilityRatio'", "InstanceFlexibilityRatio", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstanceFlexibilityRatio"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstanceId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InstanceId'", "InstanceId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstanceId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Kind".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Kind'", "Kind", global::System.Management.Automation.CompletionResultType.ParameterValue, "Kind"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationId'", "ReservationId", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationOrderId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationOrderId'", "ReservationOrderId", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationOrderId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservedHours".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservedHours'", "ReservedHours", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservedHours"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SkuName".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SkuName'", "SkuName", global::System.Management.Automation.CompletionResultType.ParameterValue, "SkuName"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TotalReservedQuantity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TotalReservedQuantity'", "TotalReservedQuantity", global::System.Management.Automation.CompletionResultType.ParameterValue, "TotalReservedQuantity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UsageDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UsageDate'", "UsageDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "UsageDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UsedHours".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UsedHours'", "UsedHours", global::System.Management.Automation.CompletionResultType.ParameterValue, "UsedHours"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.TypeConverter.cs deleted file mode 100644 index 320a9f73418e..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity - /// - public partial class ReservationReportSchemaTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReservationReportSchema.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.cs deleted file mode 100644 index 037cddd2c9ec..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/ReservationReportSchema.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity - /// - public partial struct ReservationReportSchema : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema InstanceFlexibilityGroup = @"InstanceFlexibilityGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema InstanceFlexibilityRatio = @"InstanceFlexibilityRatio"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema InstanceId = @"InstanceId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema Kind = @"Kind"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema ReservationId = @"ReservationId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema ReservationOrderId = @"ReservationOrderId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema ReservedHours = @"ReservedHours"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema SkuName = @"SkuName"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema TotalReservedQuantity = @"TotalReservedQuantity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema UsageDate = @"UsageDate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema UsedHours = @"UsedHours"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReservationReportSchema - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReservationReportSchema(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReservationReportSchema - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReservationReportSchema (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ReservationReportSchema && Equals((ReservationReportSchema)obj); - } - - /// Returns hashCode for enum ReservationReportSchema - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ReservationReportSchema(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReservationReportSchema - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReservationReportSchema - /// the value to convert to an instance of . - - public static implicit operator ReservationReportSchema(string value) - { - return new ReservationReportSchema(value); - } - - /// Implicit operator to convert ReservationReportSchema to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e) - { - return e._value; - } - - /// Overriding != operator for enum ReservationReportSchema - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReservationReportSchema - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ReservationReportSchema e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.Completer.cs deleted file mode 100644 index f26e0a4794fc..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.Completer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusTypeTypeConverter))] - public partial struct StatusType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Inactive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Inactive'", "Inactive", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inactive"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.TypeConverter.cs deleted file mode 100644 index 8467d003800d..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - public partial class StatusTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => StatusType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.cs deleted file mode 100644 index 529fca1b3f07..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/StatusType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. - /// - public partial struct StatusType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType Inactive = @"Inactive"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to StatusType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new StatusType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type StatusType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type StatusType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is StatusType && Equals((StatusType)obj); - } - - /// Returns hashCode for enum StatusType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private StatusType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for StatusType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to StatusType - /// the value to convert to an instance of . - - public static implicit operator StatusType(string value) - { - return new StatusType(value); - } - - /// Implicit operator to convert StatusType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e) - { - return e._value; - } - - /// Overriding != operator for enum StatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum StatusType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.Completer.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.Completer.cs deleted file mode 100644 index cee3d29baceb..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.Completer.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeTypeTypeConverter))] - public partial struct TimeframeType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MonthToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MonthToDate'", "MonthToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "MonthToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingMonthToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingMonthToDate'", "BillingMonthToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingMonthToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TheLastMonth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TheLastMonth'", "TheLastMonth", global::System.Management.Automation.CompletionResultType.ParameterValue, "TheLastMonth"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TheLastBillingMonth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TheLastBillingMonth'", "TheLastBillingMonth", global::System.Management.Automation.CompletionResultType.ParameterValue, "TheLastBillingMonth"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "WeekToDate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'WeekToDate'", "WeekToDate", global::System.Management.Automation.CompletionResultType.ParameterValue, "WeekToDate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Custom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Custom'", "Custom", global::System.Management.Automation.CompletionResultType.ParameterValue, "Custom"); - } - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.TypeConverter.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.TypeConverter.cs deleted file mode 100644 index 5eef8cd807cb..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. - /// - public partial class TimeframeTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TimeframeType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.cs b/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.cs deleted file mode 100644 index ffe91ec16adf..000000000000 --- a/generated/CostManagement/CostManagement.Autorest/generated/api/Support/TimeframeType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support -{ - - /// - /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. - /// - public partial struct TimeframeType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType BillingMonthToDate = @"BillingMonthToDate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Custom = @"Custom"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType MonthToDate = @"MonthToDate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType TheLastBillingMonth = @"TheLastBillingMonth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType TheLastMonth = @"TheLastMonth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType WeekToDate = @"WeekToDate"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TimeframeType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TimeframeType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TimeframeType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TimeframeType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is TimeframeType && Equals((TimeframeType)obj); - } - - /// Returns hashCode for enum TimeframeType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private TimeframeType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for TimeframeType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to TimeframeType - /// the value to convert to an instance of . - - public static implicit operator TimeframeType(string value) - { - return new TimeframeType(value); - } - - /// Implicit operator to convert TimeframeType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e) - { - return e._value; - } - - /// Overriding != operator for enum TimeframeType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TimeframeType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_Get.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_Get.cs index d5bcaf70c525..f591567affb5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_Get.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// @@ -15,12 +17,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] GetExecutionHistory=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementExportExecutionHistory_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to get the execution history of an export for the defined scope and export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementExportExecutionHistory_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +40,26 @@ public partial class GetAzCostManagementExportExecutionHistory_Get : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -68,6 +87,9 @@ public partial class GetAzCostManagementExportExecutionHistory_Get : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] public string ExportName { get => this._exportName; set => this._exportName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +116,7 @@ public partial class GetAzCostManagementExportExecutionHistory_Get : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -134,24 +156,24 @@ public partial class GetAzCostManagementExportExecutionHistory_Get : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -174,6 +196,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -195,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementExportExecutionHistory_Get() { @@ -246,8 +273,33 @@ public GetAzCostManagementExportExecutionHistory_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +352,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,ExportName=ExportName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,ExportName=ExportName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -356,12 +408,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -378,15 +430,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, ExportName=ExportName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, ExportName=ExportName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -396,12 +448,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -413,9 +465,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_GetViaIdentity.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_GetViaIdentity.cs index f7aa4162ebfe..255542cac68c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_GetViaIdentity.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExportExecutionHistory_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// @@ -15,12 +17,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] GetExecutionHistory=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementExportExecutionHistory_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to get the execution history of an export for the defined scope and export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementExportExecutionHistory_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +40,26 @@ public partial class GetAzCostManagementExportExecutionHistory_GetViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -54,6 +73,9 @@ public partial class GetAzCostManagementExportExecutionHistory_GetViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -88,7 +110,7 @@ public partial class GetAzCostManagementExportExecutionHistory_GetViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -111,24 +133,24 @@ public partial class GetAzCostManagementExportExecutionHistory_GetViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -151,6 +173,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -172,7 +199,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementExportExecutionHistory_GetViaIdentity() { @@ -223,8 +250,33 @@ public GetAzCostManagementExportExecutionHistory_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -277,7 +329,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,7 +363,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,12 +401,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -371,7 +423,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -389,12 +441,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportExecutionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -406,9 +458,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportExecutionListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_Get.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_Get.cs index 3997d6ebe328..9e34c4b7e066 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_Get.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to get the export for the defined scope by export name. @@ -13,12 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementExport_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to get the export for the defined scope by export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementExport_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class GetAzCostManagementExport_Get : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -69,6 +88,9 @@ public partial class GetAzCostManagementExport_Get : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -110,7 +132,7 @@ public partial class GetAzCostManagementExport_Get : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -150,24 +172,24 @@ public partial class GetAzCostManagementExport_Get : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -190,6 +212,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -211,7 +238,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementExport_Get() { @@ -262,8 +289,33 @@ public GetAzCostManagementExport_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -316,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -334,7 +386,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -372,12 +424,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -394,15 +446,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -412,12 +464,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -429,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_GetViaIdentity.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_GetViaIdentity.cs index 48e882fedbcf..26dce3ef4ff3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_GetViaIdentity.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to get the export for the defined scope by export name. @@ -13,12 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementExport_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to get the export for the defined scope by export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementExport_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class GetAzCostManagementExport_GetViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -69,6 +88,9 @@ public partial class GetAzCostManagementExport_GetViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -103,7 +125,7 @@ public partial class GetAzCostManagementExport_GetViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -126,24 +148,24 @@ public partial class GetAzCostManagementExport_GetViaIdentity : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -166,6 +188,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +214,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementExport_GetViaIdentity() { @@ -238,8 +265,33 @@ public GetAzCostManagementExport_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +344,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -364,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -386,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -404,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -421,8 +473,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_List.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_List.cs index b250a31dd38f..585bbc5854ea 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_List.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementExport_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to list all exports at the given scope. @@ -13,12 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.CostManagement/exports" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementExport_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to list all exports at the given scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementExport_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class GetAzCostManagementExport_List : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -69,6 +88,9 @@ public partial class GetAzCostManagementExport_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -95,7 +117,7 @@ public partial class GetAzCostManagementExport_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -135,24 +157,24 @@ public partial class GetAzCostManagementExport_List : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -175,6 +197,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -196,7 +223,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementExport_List() { @@ -247,8 +274,33 @@ public GetAzCostManagementExport_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +353,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,12 +409,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -379,15 +431,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -397,12 +449,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExportListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,9 +466,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExportListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementOperation_List.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementOperation_List.cs index 7cceceeafa5f..aa7f6fb2a7ec 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementOperation_List.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/GetAzCostManagementOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// Lists all of the available cost management REST API operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostManagementOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"Lists all of the available cost management REST API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/providers/Microsoft.CostManagement/operations", ApiVersion = "2021-10-01")] public partial class GetAzCostManagementOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzCostManagementOperation_List : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzCostManagementOperation_List : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class GetAzCostManagementOperation_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -108,24 +129,24 @@ public partial class GetAzCostManagementOperation_List : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -148,6 +169,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -169,7 +195,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzCostManagementOperation_List() { @@ -220,8 +246,33 @@ public GetAzCostManagementOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -274,7 +325,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -330,12 +381,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -352,7 +403,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_Execute.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_Execute.cs index ab53187f17d9..88996cb6a030 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_Execute.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_Execute.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to execute an export. @@ -15,10 +17,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostManagementExecuteExport_Execute", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to execute an export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run", ApiVersion = "2021-10-01")] public partial class InvokeAzCostManagementExecuteExport_Execute : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class InvokeAzCostManagementExecuteExport_Execute : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -66,6 +85,9 @@ public partial class InvokeAzCostManagementExecuteExport_Execute : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] public string ExportName { get => this._exportName; set => this._exportName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,7 +121,7 @@ public partial class InvokeAzCostManagementExecuteExport_Execute : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,12 +161,12 @@ public partial class InvokeAzCostManagementExecuteExport_Execute : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -177,6 +199,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +225,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzCostManagementExecuteExport_Execute() { @@ -249,8 +276,33 @@ public InvokeAzCostManagementExecuteExport_Execute() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,ExportName=ExportName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,ExportName=ExportName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +414,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +436,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, ExportName=ExportName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, ExportName=ExportName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_ExecuteViaIdentity.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_ExecuteViaIdentity.cs index dd74bdafe565..6a179db504ae 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_ExecuteViaIdentity.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementExecuteExport_ExecuteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to execute an export. @@ -15,10 +17,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostManagementExecuteExport_ExecuteViaIdentity", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to execute an export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run", ApiVersion = "2021-10-01")] public partial class InvokeAzCostManagementExecuteExport_ExecuteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class InvokeAzCostManagementExecuteExport_ExecuteViaIdentity : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -52,6 +71,9 @@ public partial class InvokeAzCostManagementExecuteExport_ExecuteViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +115,7 @@ public partial class InvokeAzCostManagementExecuteExport_ExecuteViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +138,12 @@ public partial class InvokeAzCostManagementExecuteExport_ExecuteViaIdentity : gl /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -154,6 +176,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -175,7 +202,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzCostManagementExecuteExport_ExecuteViaIdentity() { @@ -226,8 +253,33 @@ public InvokeAzCostManagementExecuteExport_ExecuteViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -283,7 +335,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +429,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By.cs index 045fc99389d1..14705e6b80af 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// @@ -16,12 +18,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] ByBillingAccountId=>POST:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostManagementReservationDetailReport_By", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"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/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport", ApiVersion = "2021-10-01")] public partial class InvokeAzCostManagementReservationDetailReport_By : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +41,18 @@ public partial class InvokeAzCostManagementReservationDetailReport_By : global:: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] @@ -61,6 +77,9 @@ public partial class InvokeAzCostManagementReservationDetailReport_By : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -88,6 +107,9 @@ public partial class InvokeAzCostManagementReservationDetailReport_By : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Query)] public string EndDate { get => this._endDate; set => this._endDate = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -122,7 +144,7 @@ public partial class InvokeAzCostManagementReservationDetailReport_By : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -159,24 +181,24 @@ public partial class InvokeAzCostManagementReservationDetailReport_By : global:: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -222,6 +244,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets.InvokeAzCostMan /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -243,7 +270,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzCostManagementReservationDetailReport_By() { @@ -294,11 +321,36 @@ public InvokeAzCostManagementReservationDetailReport_By() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -310,10 +362,26 @@ public InvokeAzCostManagementReservationDetailReport_By() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -381,7 +449,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -399,7 +467,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,StartDate=StartDate,EndDate=EndDate}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,StartDate=StartDate,EndDate=EndDate}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -437,12 +505,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -459,15 +527,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, StartDate=StartDate, EndDate=EndDate }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, StartDate=StartDate, EndDate=EndDate }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -477,12 +545,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -494,8 +562,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By1.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By1.cs index 40101e7d76b6..73e14bfbfc2d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By1.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/InvokeAzCostManagementReservationDetailReport_By1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// @@ -16,12 +18,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] ByBillingProfileId=>POST:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostManagementReservationDetailReport_By1", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"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/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport", ApiVersion = "2021-10-01")] public partial class InvokeAzCostManagementReservationDetailReport_By1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +41,18 @@ public partial class InvokeAzCostManagementReservationDetailReport_By1 : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] @@ -75,6 +91,9 @@ public partial class InvokeAzCostManagementReservationDetailReport_By1 : global: [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -102,6 +121,9 @@ public partial class InvokeAzCostManagementReservationDetailReport_By1 : global: [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Query)] public string EndDate { get => this._endDate; set => this._endDate = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -136,7 +158,7 @@ public partial class InvokeAzCostManagementReservationDetailReport_By1 : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -173,24 +195,24 @@ public partial class InvokeAzCostManagementReservationDetailReport_By1 : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -237,6 +259,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets.InvokeAzCostMan /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -258,7 +285,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzCostManagementReservationDetailReport_By1() { @@ -309,11 +336,36 @@ public InvokeAzCostManagementReservationDetailReport_By1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -325,10 +377,26 @@ public InvokeAzCostManagementReservationDetailReport_By1() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -396,7 +464,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -414,7 +482,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,BillingProfileId=BillingProfileId,StartDate=StartDate,EndDate=EndDate}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId,BillingProfileId=BillingProfileId,StartDate=StartDate,EndDate=EndDate}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -452,12 +520,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -474,15 +542,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, BillingProfileId=BillingProfileId, StartDate=StartDate, EndDate=EndDate }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { BillingAccountId=BillingAccountId, BillingProfileId=BillingProfileId, StartDate=StartDate, EndDate=EndDate }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -492,12 +560,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -509,8 +577,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperationStatus - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperationStatus + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateExpanded.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateExpanded.cs index fdad0f1e7572..e767c81dc094 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateExpanded.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// @@ -22,12 +24,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets /// [OpenAPI] CreateOperation=>POST:"/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementDetailReport_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport", ApiVersion = "2022-05-01")] public partial class NewAzCostManagementDetailReport_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -43,8 +47,20 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The definition of a cost detailed report. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.GenerateCostDetailsReportRequestDefinition(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportRequestDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.GenerateCostDetailsReportRequestDefinition(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -71,6 +87,9 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -84,6 +103,9 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -123,9 +145,9 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy ReadOnly = false, Description = @"The type of the detailed report. By default ActualCost is provided", SerializedName = @"metric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.CostDetailsMetricType)""); set => _parametersBody.Metric = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("ActualCost", "AmortizedCost")] + public string Metric { get => _parametersBody.Metric ?? null; set => _parametersBody.Metric = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -146,7 +168,7 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -214,24 +236,24 @@ public partial class NewAzCostManagementDetailReport_CreateExpanded : global::Sy /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -276,6 +298,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets.NewAzCostManage /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -340,11 +367,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -356,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -369,7 +437,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzCostManagementDetailReport_CreateExpanded() { @@ -435,7 +503,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -453,7 +521,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -491,12 +559,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.IGenerateCostDetailsReportErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -513,15 +581,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -531,12 +599,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -548,8 +616,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20220501.ICostDetailsOperationResults - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonFilePath.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..ad6376c2d022 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonFilePath.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOperation=>POST:"/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementDetailReport_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport", ApiVersion = "2022-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class NewAzCostManagementDetailReport_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzCostManagementDetailReport_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets.NewAzCostManagementDetailReport_CreateViaJsonFilePath Clone() + { + var clone = new NewAzCostManagementDetailReport_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Scope = this.Scope; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzCostManagementDetailReport_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateCostDetailsReportCreateOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateCostDetailsReportCreateOperationViaJsonString(Scope, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonString.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonString.cs new file mode 100644 index 000000000000..2ced3fb947eb --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementDetailReport_CreateViaJsonString.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOperation=>POST:"/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementDetailReport_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport", ApiVersion = "2022-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class NewAzCostManagementDetailReport_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. + /// Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzCostManagementDetailReport_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets.NewAzCostManagementDetailReport_CreateViaJsonString Clone() + { + var clone = new NewAzCostManagementDetailReport_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Scope = this.Scope; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzCostManagementDetailReport_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateCostDetailsReportCreateOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateCostDetailsReportCreateOperationViaJsonString(Scope, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IGenerateCostDetailsReportErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostDetailsOperationResults + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateExpanded.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateExpanded.cs index c220e5c8f06e..d6005a4c833b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateExpanded.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateExpanded.cs @@ -6,23 +6,27 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// - /// The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. - /// To obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementExport_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] - [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class NewAzCostManagementExport_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,14 +42,29 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An export resource. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -62,7 +81,7 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = value; } + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ConfigurationColumn = (value != null ? new System.Collections.Generic.List(value) : null); } /// The granularity of rows in the export. Currently only 'Daily' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the export. Currently only 'Daily' is supported.")] @@ -72,9 +91,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType DataSetGranularity { get => _parametersBody.DataSetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); set => _parametersBody.DataSetGranularity = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + public string DataSetGranularity { get => _parametersBody.DataSetGranularity ?? null; set => _parametersBody.DataSetGranularity = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -96,9 +115,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); set => _parametersBody.DefinitionTimeframe = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + public string DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? null; set => _parametersBody.DefinitionTimeframe = value; } /// /// The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide @@ -111,9 +130,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); set => _parametersBody.DefinitionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + public string DefinitionType { get => _parametersBody.DefinitionType ?? null; set => _parametersBody.DefinitionType = value; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. @@ -197,6 +216,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M PossibleTypes = new [] { typeof(string) })] public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// The format of the export being delivered. Currently only 'Csv' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The format of the export being delivered. Currently only 'Csv' is supported.")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Body)] @@ -205,9 +227,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Format { get => _parametersBody.Format ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); set => _parametersBody.Format = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + public string Format { get => _parametersBody.Format ?? null; set => _parametersBody.Format = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -264,7 +286,7 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -312,9 +334,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"The schedule recurrence.", SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType)""); set => _parametersBody.ScheduleRecurrence = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + public string ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? null; set => _parametersBody.ScheduleRecurrence = value; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. @@ -326,9 +348,9 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M ReadOnly = false, Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType ScheduleStatus { get => _parametersBody.ScheduleStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType)""); set => _parametersBody.ScheduleStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + public string ScheduleStatus { get => _parametersBody.ScheduleStatus ?? null; set => _parametersBody.ScheduleStatus = value; } /// Backing field for property. private string _scope; @@ -374,36 +396,36 @@ public partial class NewAzCostManagementExport_CreateExpanded : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -426,6 +448,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -490,8 +517,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -501,7 +553,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzCostManagementExport_CreateExpanded() { @@ -555,7 +607,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -568,12 +620,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ExportsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ExportsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -609,12 +661,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -626,8 +678,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -635,12 +705,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -657,15 +727,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -675,12 +745,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -692,8 +762,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonFilePath.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..7f64761a37c4 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonFilePath.cs @@ -0,0 +1,567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementExport_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class NewAzCostManagementExport_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ExportName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide + /// Service'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzCostManagementExport_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsCreateOrUpdateViaJsonString(Scope, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonString.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonString.cs new file mode 100644 index 000000000000..76043b50544a --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/NewAzCostManagementExport_CreateViaJsonString.cs @@ -0,0 +1,565 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostManagementExport_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class NewAzCostManagementExport_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ExportName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide + /// Service'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzCostManagementExport_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsCreateOrUpdateViaJsonString(Scope, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_Delete.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_Delete.cs index 8672e48e57aa..976c0cf286b5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_Delete.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to delete a export. @@ -15,10 +17,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostManagementExport_Delete", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to delete a export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class RemoveAzCostManagementExport_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class RemoveAzCostManagementExport_Delete : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -52,6 +71,9 @@ public partial class RemoveAzCostManagementExport_Delete : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +122,7 @@ public partial class RemoveAzCostManagementExport_Delete : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -140,12 +162,12 @@ public partial class RemoveAzCostManagementExport_Delete : global::System.Manage /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -178,6 +200,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -242,8 +269,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -299,7 +351,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -330,7 +382,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzCostManagementExport_Delete() { @@ -363,12 +415,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -385,15 +437,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_DeleteViaIdentity.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_DeleteViaIdentity.cs index a8c445e6983d..e2c825ed02c1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_DeleteViaIdentity.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/RemoveAzCostManagementExport_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// The operation to delete a export. @@ -15,10 +17,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostManagementExport_DeleteViaIdentity", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to delete a export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class RemoveAzCostManagementExport_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +38,26 @@ public partial class RemoveAzCostManagementExport_DeleteViaIdentity : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -52,6 +71,9 @@ public partial class RemoveAzCostManagementExport_DeleteViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +115,7 @@ public partial class RemoveAzCostManagementExport_DeleteViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +138,12 @@ public partial class RemoveAzCostManagementExport_DeleteViaIdentity : global::Sy /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -154,6 +176,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +245,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,7 +374,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzCostManagementExport_DeleteViaIdentity() { @@ -355,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +429,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateExpanded.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateExpanded.cs index 19badd1c8fbc..9b1b114151f5 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateExpanded.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateExpanded.cs @@ -6,23 +6,27 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// - /// The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. - /// To obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzCostManagementExport_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] - [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class UpdateAzCostManagementExport_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,14 +42,29 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An export resource. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -62,7 +81,7 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = value; } + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ConfigurationColumn = (value != null ? new System.Collections.Generic.List(value) : null); } /// The granularity of rows in the export. Currently only 'Daily' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the export. Currently only 'Daily' is supported.")] @@ -72,9 +91,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType DataSetGranularity { get => _parametersBody.DataSetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); set => _parametersBody.DataSetGranularity = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + public string DataSetGranularity { get => _parametersBody.DataSetGranularity ?? null; set => _parametersBody.DataSetGranularity = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -96,9 +115,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); set => _parametersBody.DefinitionTimeframe = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + public string DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? null; set => _parametersBody.DefinitionTimeframe = value; } /// /// The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide @@ -111,9 +130,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); set => _parametersBody.DefinitionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + public string DefinitionType { get => _parametersBody.DefinitionType ?? null; set => _parametersBody.DefinitionType = value; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. @@ -197,6 +216,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste PossibleTypes = new [] { typeof(string) })] public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// The format of the export being delivered. Currently only 'Csv' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The format of the export being delivered. Currently only 'Csv' is supported.")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Body)] @@ -205,9 +227,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Format { get => _parametersBody.Format ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); set => _parametersBody.Format = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + public string Format { get => _parametersBody.Format ?? null; set => _parametersBody.Format = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -264,7 +286,7 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -312,9 +334,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The schedule recurrence.", SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType)""); set => _parametersBody.ScheduleRecurrence = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + public string ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? null; set => _parametersBody.ScheduleRecurrence = value; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. @@ -326,9 +348,9 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType ScheduleStatus { get => _parametersBody.ScheduleStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType)""); set => _parametersBody.ScheduleStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + public string ScheduleStatus { get => _parametersBody.ScheduleStatus ?? null; set => _parametersBody.ScheduleStatus = value; } /// Backing field for property. private string _scope; @@ -374,36 +396,36 @@ public partial class UpdateAzCostManagementExport_UpdateExpanded : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -426,6 +448,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -490,8 +517,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -547,7 +599,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -560,12 +612,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ExportsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ExportsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -585,7 +637,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzCostManagementExport_UpdateExpanded() { @@ -609,12 +661,12 @@ public UpdateAzCostManagementExport_UpdateExpanded() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -626,8 +678,26 @@ public UpdateAzCostManagementExport_UpdateExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -635,12 +705,12 @@ public UpdateAzCostManagementExport_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -657,15 +727,15 @@ public UpdateAzCostManagementExport_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -675,12 +745,12 @@ public UpdateAzCostManagementExport_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -692,8 +762,26 @@ public UpdateAzCostManagementExport_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaIdentityExpanded.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaIdentityExpanded.cs index 59ed20423dc3..4969e0b38d79 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaIdentityExpanded.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaIdentityExpanded.cs @@ -6,23 +6,27 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; using System; /// - /// The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. - /// To obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzCostManagementExport_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport))] - [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to create or update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,14 +42,29 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An export resource. - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.Export(); + private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Export(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; @@ -62,7 +81,7 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl Description = @"Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", SerializedName = @"columns", PossibleTypes = new [] { typeof(string) })] - public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = value; } + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ConfigurationColumn = (value != null ? new System.Collections.Generic.List(value) : null); } /// The granularity of rows in the export. Currently only 'Daily' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the export. Currently only 'Daily' is supported.")] @@ -72,9 +91,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", SerializedName = @"granularity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType DataSetGranularity { get => _parametersBody.DataSetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType)""); set => _parametersBody.DataSetGranularity = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] + public string DataSetGranularity { get => _parametersBody.DataSetGranularity ?? null; set => _parametersBody.DataSetGranularity = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -96,9 +115,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The time frame for pulling data for the export. If custom, then a specific time period must be provided.", SerializedName = @"timeframe", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType)""); set => _parametersBody.DefinitionTimeframe = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] + public string DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? null; set => _parametersBody.DefinitionTimeframe = value; } /// /// The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide @@ -111,9 +130,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"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.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType)""); set => _parametersBody.DefinitionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] + public string DefinitionType { get => _parametersBody.DefinitionType ?? null; set => _parametersBody.DefinitionType = value; } /// /// The name of the container where exports will be uploaded. If the container does not exist it will be created. @@ -197,6 +216,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl PossibleTypes = new [] { typeof(string) })] public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// The format of the export being delivered. Currently only 'Csv' is supported. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The format of the export being delivered. Currently only 'Csv' is supported.")] [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Body)] @@ -205,9 +227,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", SerializedName = @"format", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Format { get => _parametersBody.Format ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType)""); set => _parametersBody.Format = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] + public string Format { get => _parametersBody.Format ?? null; set => _parametersBody.Format = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -257,7 +279,7 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -305,9 +327,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The schedule recurrence.", SerializedName = @"recurrence", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType)""); set => _parametersBody.ScheduleRecurrence = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] + public string ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? null; set => _parametersBody.ScheduleRecurrence = value; } /// /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. @@ -319,9 +341,9 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The status of the export's schedule. If 'Inactive', the export's schedule is paused.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType))] - public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType ScheduleStatus { get => _parametersBody.ScheduleStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType)""); set => _parametersBody.ScheduleStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] + public string ScheduleStatus { get => _parametersBody.ScheduleStatus ?? null; set => _parametersBody.ScheduleStatus = value; } /// The start date for export data. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date for export data.")] @@ -350,36 +372,36 @@ public partial class UpdateAzCostManagementExport_UpdateViaIdentityExpanded : gl /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -402,6 +424,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -466,8 +493,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -523,7 +575,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -538,7 +590,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ExportsCreateOrUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ExportsCreateOrUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate); } else { @@ -551,13 +603,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExportName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ExportsCreateOrUpdate(InputObject.Scope ?? null, InputObject.ExportName ?? null, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ExportsCreateOrUpdate(InputObject.Scope ?? null, InputObject.ExportName ?? null, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SerializationMode.IncludeCreate); } await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -577,7 +629,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() { @@ -601,12 +653,12 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -618,8 +670,26 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -627,12 +697,12 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -649,15 +719,15 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -667,12 +737,12 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -684,8 +754,26 @@ public UpdateAzCostManagementExport_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonFilePath.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..be7b5b87f0e4 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonFilePath.cs @@ -0,0 +1,567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzCostManagementExport_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class UpdateAzCostManagementExport_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ExportName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide + /// Service'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsCreateOrUpdateViaJsonString(Scope, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzCostManagementExport_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonString.cs b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonString.cs new file mode 100644 index 000000000000..046ac79e085c --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/cmdlets/UpdateAzCostManagementExport_UpdateViaJsonString.cs @@ -0,0 +1,565 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets; + using System; + + /// + /// The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To + /// obtain the latest eTag for a given export, perform a get operation prior to your put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzCostManagementExport_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Description(@"The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ExternalDocs(@"https://docs.microsoft.com/en-us/rest/api/costmanagement/", @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.HttpPath(Path = "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", ApiVersion = "2021-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.NotSuggestDefaultParameterSet] + public partial class UpdateAzCostManagementExport_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ExportName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide + /// Service'. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.")] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category(global::Microsoft.Azure.PowerShell.Cmdlets.CostManagement.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsCreateOrUpdateViaJsonString(Scope, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzCostManagementExport_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..9a89961d954e --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..f31dcc2cbff8 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 6fd131c94d67..aeca87af23c6 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index a17516094711..5c75df7aa3ca 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index bf2a4d0d9be9..3c31084cdca1 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 320784ff9a4f..2d78c63f314e 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 30963907bad9..4cf40dbdc305 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 69f3c8adadc1..a4b2abe39ea3 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 8e143292f716..0ba9754faf70 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 1d41c06cb0db..a7772712490c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index b3ca441933b8..8648d3222218 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 2c3babd762e1..7a7f1c62ee2c 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 9a882cc659aa..6136df0a1cae 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 181f0596aee0..67e3ddf5a7bc 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Context.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..9fc015f51a7e --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CostManagement.CostManagement Client { get; } + } +} diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Events.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Events.cs index 8de84b629dc3..ac6aa19eab6a 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Events.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/ISendAsync.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/ISendAsync.cs index 6bb4333b6dd2..584e1a86be0d 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/InfoAttribute.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/InfoAttribute.cs index b6c01cb49533..927031c85e91 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/InputHandler.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..b8358d4e8ba8 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index bf091791b250..e5de2b4d868b 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/SerializationMode.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/SerializationMode.cs index 7fcf21e67c94..cebad6740be8 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/CostManagement/CostManagement.Autorest/generated/runtime/TypeConverterExtensions.cs index fead2af6b5f9..8ebceffe98af 100644 --- a/generated/CostManagement/CostManagement.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/CostManagement/CostManagement.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/CostManagement/CostManagement.Autorest/internal/Get-AzCostManagementOperation.ps1 b/generated/CostManagement/CostManagement.Autorest/internal/Get-AzCostManagementOperation.ps1 index 4afeb5185eee..36634d69afa0 100644 --- a/generated/CostManagement/CostManagement.Autorest/internal/Get-AzCostManagementOperation.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/internal/Get-AzCostManagementOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available cost management REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementoperation #> function Get-AzCostManagementOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.CostManagement.private\Get-AzCostManagementOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/internal/New-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/internal/New-AzCostManagementExport.ps1 index 277610a1e75a..02d449af1ba2 100644 --- a/generated/CostManagement/CostManagement.Autorest/internal/New-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/internal/New-AzCostManagementExport.ps1 @@ -16,23 +16,25 @@ <# .Synopsis -The operation to create or update an export. +The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Description -The operation to create or update an export. +The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Example New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function New-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -48,7 +50,7 @@ param( # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -57,51 +59,51 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # A SAS token for the storage account. @@ -111,74 +113,86 @@ param( # To update this value a new SAS token must be specified. ${DestinationSasToken}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The storage account where exports will be uploaded. # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. ${DestinationStorageAccount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.Management.Automation.SwitchParameter] # 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 modern commerce scopes. ${PartitionData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -235,12 +249,20 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.CostManagement.private\New-AzCostManagementExport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.CostManagement.private\New-AzCostManagementExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.CostManagement.private\New-AzCostManagementExport_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/CostManagement/CostManagement.Autorest/internal/ProxyCmdletDefinitions.ps1 index 30d2e0a7f036..f685e071c667 100644 --- a/generated/CostManagement/CostManagement.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ Lists all of the available cost management REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.costmanagement/get-azcostmanagementoperation #> function Get-AzCostManagementOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.CostManagement.private\Get-AzCostManagementOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -126,23 +132,25 @@ end { <# .Synopsis -The operation to create or update an export. +The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Description -The operation to create or update an export. +The operation to create an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Example New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Link https://learn.microsoft.com/powershell/module/az.costmanagement/new-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function New-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -158,7 +166,7 @@ param( # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -167,51 +175,51 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # A SAS token for the storage account. @@ -221,74 +229,86 @@ param( # To update this value a new SAS token must be specified. ${DestinationSasToken}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The storage account where exports will be uploaded. # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. ${DestinationStorageAccount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.Management.Automation.SwitchParameter] # 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 modern commerce scopes. ${PartitionData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -345,12 +365,20 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.CostManagement.private\New-AzCostManagementExport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.CostManagement.private\New-AzCostManagementExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.CostManagement.private\New-AzCostManagementExport_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -382,11 +410,11 @@ end { <# .Synopsis -The operation to create or update an export. +The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Description -The operation to create or update an export. +The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Example @@ -398,7 +426,7 @@ Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekl .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Notes COMPLEX PARAMETER PROPERTIES @@ -410,19 +438,23 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/update-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Update-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ExportName')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] @@ -430,6 +462,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. @@ -439,10 +473,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -451,51 +485,58 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # A SAS token for the storage account. @@ -505,74 +546,96 @@ param( # To update this value a new SAS token must be specified. ${DestinationSasToken}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The storage account where exports will be uploaded. # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. ${DestinationStorageAccount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.Management.Automation.SwitchParameter] # 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 modern commerce scopes. ${PartitionData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -629,13 +692,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/internal/Update-AzCostManagementExport.ps1 b/generated/CostManagement/CostManagement.Autorest/internal/Update-AzCostManagementExport.ps1 index 9b6c901a3538..6337d8ef8d75 100644 --- a/generated/CostManagement/CostManagement.Autorest/internal/Update-AzCostManagementExport.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/internal/Update-AzCostManagementExport.ps1 @@ -16,11 +16,11 @@ <# .Synopsis -The operation to create or update an export. +The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Description -The operation to create or update an export. +The operation to update an export. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given export, perform a get operation prior to your put operation. .Example @@ -32,7 +32,7 @@ Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekl .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport .Notes COMPLEX PARAMETER PROPERTIES @@ -44,19 +44,23 @@ INPUTOBJECT : Identity Parameter [BillingProfileId ]: BillingProfile ID [ExportName ]: Export Name. [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. [Id ]: Resource identity path [OperationId ]: The target operation Id. [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. [ViewName ]: View name .Link https://learn.microsoft.com/powershell/module/az.costmanagement/update-azcostmanagementexport +.Link +https://docs.microsoft.com/en-us/rest/api/costmanagement/ #> function Update-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IExport])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.IExport])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ExportName')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] @@ -64,6 +68,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. @@ -73,10 +79,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] @@ -85,51 +91,58 @@ param( # The available columns can vary by customer channel (see examples). ${ConfigurationColumn}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + [System.String] # The granularity of rows in the export. # Currently only 'Daily' is supported. ${DataSetGranularity}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + [System.String] # The time frame for pulling data for the export. # If custom, then a specific time period must be provided. ${DefinitionTimeframe}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Usage", "ActualCost", "AmortizedCost")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + [System.String] # 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. ${DefinitionType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the container where exports will be uploaded. # If the container does not exist it will be created. ${DestinationContainer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The resource id of the storage account where exports will be delivered. # This is not required if a sasToken and storageAccount are specified. ${DestinationResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The name of the directory where exports will be uploaded. ${DestinationRootFolderPath}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # A SAS token for the storage account. @@ -139,74 +152,96 @@ param( # To update this value a new SAS token must be specified. ${DestinationSasToken}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # The storage account where exports will be uploaded. # For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId. ${DestinationStorageAccount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String] # 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. ${ETag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Csv")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + [System.String] # The format of the export being delivered. # Currently only 'Csv' is supported. ${Format}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.Management.Automation.SwitchParameter] # 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 modern commerce scopes. ${PartitionData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date of recurrence. ${RecurrencePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date of recurrence. ${RecurrencePeriodTo}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Daily", "Weekly", "Monthly", "Annually")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + [System.String] # The schedule recurrence. ${ScheduleRecurrence}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.PSArgumentCompleterAttribute("Active", "Inactive")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + [System.String] # The status of the export's schedule. # If 'Inactive', the export's schedule is paused. ${ScheduleStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date for export data. ${TimePeriodFrom}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date for export data. ${TimePeriodTo}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -263,13 +298,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.CostManagement.private\Update-AzCostManagementExport_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/CostManagement/CostManagement.Autorest/resources/README.md b/generated/CostManagement/CostManagement.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/CostManagement/CostManagement.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/CostManagement/CostManagement.Autorest/test-module.ps1 b/generated/CostManagement/CostManagement.Autorest/test-module.ps1 index 59e7b5dad6fd..d1b5a563e200 100644 --- a/generated/CostManagement/CostManagement.Autorest/test-module.ps1 +++ b/generated/CostManagement/CostManagement.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'